Skip to content

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

refactor(cron): route embed through core cron re-exports

Steven Enamakel92fc738d0e18
diff --git a/Cargo.lock b/Cargo.lock
index 6489aa603b..a4e1e6de03 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4125,6 +4125,7 @@ dependencies = [
"thiserror 2.0.20",
"tinyagents-harness",
"tinyagents-session",
+ "tinybus",
"tinyinference-embeddings",
"tinyinference-llm",
"tinymcp-bus",
diff --git a/crates/openhuman-core/src/core/bus.rs b/crates/openhuman-core/src/core/bus.rs
index 7ca75c3c20..c33357fc94 100644
--- a/crates/openhuman-core/src/core/bus.rs
+++ b/crates/openhuman-core/src/core/bus.rs
@@ -36,10 +36,10 @@
//! keep working, and an early-startup publish does not panic.
use tinybus::events::EventBusConfig;
-// Curated adapter types for hosts subscribing without a second bus dependency.
+// Consumers import the shared event contracts from TinyBus directly.
use tinybus::global::OnceBus;
use tinybus::version::{InterfaceVersion, PeerManifest, Version};
-pub use tinybus::{EventHandler, SubscriptionHandle};
+use tinybus::{EventHandler, SubscriptionHandle};
use crate::core::events::DomainEvent;
diff --git a/crates/openhuman-core/src/cron/job_builder.rs b/crates/openhuman-core/src/cron/job_builder.rs
index 2c608e0271..0285280281 100644
--- a/crates/openhuman-core/src/cron/job_builder.rs
+++ b/crates/openhuman-core/src/cron/job_builder.rs
@@ -8,7 +8,12 @@
//! delivery the caller states explicitly always wins.
use crate::config::Config;
-use {crate::cron::self, tinyflows_schedule::types::delivery_mode, tinyflows_sqlite::schedule::AgentJobSpec, tinyflows_schedule::types::CronJob, tinyflows_schedule::types::DeliveryConfig, tinyflows_schedule::types::JobOrigin, tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget};
+use {
+ crate::cron, tinyflows_schedule::types::delivery_mode, tinyflows_schedule::types::CronJob,
+ tinyflows_schedule::types::DeliveryConfig, tinyflows_schedule::types::JobOrigin,
+ tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget,
+ tinyflows_sqlite::schedule::AgentJobSpec,
+};
/// What an agent job creation request carries; everything defaults.
pub struct AgentJobInput {
diff --git a/crates/openhuman-core/src/cron/mod.rs b/crates/openhuman-core/src/cron/mod.rs
index aff93a72f0..4360b932a3 100644
--- a/crates/openhuman-core/src/cron/mod.rs
+++ b/crates/openhuman-core/src/cron/mod.rs
@@ -42,6 +42,9 @@ pub use store::{
find_flow_schedule_job, get_job, list_jobs, list_runs, record_last_run, record_run,
record_run_with_delivery, remove_job, reschedule_after_run, update_job,
};
+// Retained until the released TinyFlows schedule bus contract is available
+// (tinyhumansai/tinyflows#120). Embed must not link its implementation library
+// just to reach these existing cron types. The #7397 cutover removes this facade.
#[allow(unused_imports)]
pub use tinyflows_schedule::schedule::{
next_run_for_schedule, normalize_expression, runs_closer_than, schedule_cron_expression,
diff --git a/crates/openhuman-core/src/cron/ops.rs b/crates/openhuman-core/src/cron/ops.rs
index 1d4ef98fc1..ed4b61a6ae 100644
--- a/crates/openhuman-core/src/cron/ops.rs
+++ b/crates/openhuman-core/src/cron/ops.rs
@@ -1,12 +1,16 @@
use crate::config::Config;
use crate::core::Outcome;
-use {crate::cron::self, crate::cron::add_shell_job, crate::cron::get_job, crate::cron::update_job, tinyflows_schedule::types::CronJob, tinyflows_schedule::types::CronJobPatch, tinyflows_schedule::types::CronRun, tinyflows_schedule::types::Schedule};
use crate::security::SecurityPolicy;
use anyhow::Result;
use once_cell::sync::Lazy;
use serde_json::json;
use std::collections::HashSet;
use std::sync::Mutex;
+use {
+ crate::cron, crate::cron::add_shell_job, crate::cron::get_job, crate::cron::update_job,
+ tinyflows_schedule::types::CronJob, tinyflows_schedule::types::CronJobPatch,
+ tinyflows_schedule::types::CronRun, tinyflows_schedule::types::Schedule,
+};
/// Guard against duplicate concurrent "Run Now" executions per job.
/// Entries are inserted before spawning and removed when the task completes.
diff --git a/crates/openhuman-core/src/cron/ops_tests.rs b/crates/openhuman-core/src/cron/ops_tests.rs
index 4e5708e319..e37f4d888b 100644
--- a/crates/openhuman-core/src/cron/ops_tests.rs
+++ b/crates/openhuman-core/src/cron/ops_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use {tinyflows_schedule::types::ActiveHours};
use tempfile::TempDir;
+use tinyflows_schedule::types::ActiveHours;
fn test_config(tmp: &TempDir) -> Config {
let config = Config {
diff --git a/crates/openhuman-core/src/cron/origin.rs b/crates/openhuman-core/src/cron/origin.rs
index ea3e940a04..9c3e6c1c2a 100644
--- a/crates/openhuman-core/src/cron/origin.rs
+++ b/crates/openhuman-core/src/cron/origin.rs
@@ -8,8 +8,11 @@
//! external-effect tools stay gated exactly like its creator's were.
use crate::agent::turn_origin::{self, AgentTurnOrigin};
-use {tinyflows_schedule::types::delivery_mode, tinyflows_schedule::types::CronJob, tinyflows_schedule::types::JobOrigin};
use serde_json::Value;
+use {
+ tinyflows_schedule::types::delivery_mode, tinyflows_schedule::types::CronJob,
+ tinyflows_schedule::types::JobOrigin,
+};
/// Map a live turn origin onto the origin a job created in it records.
///
diff --git a/crates/openhuman-core/src/cron/origin_tests.rs b/crates/openhuman-core/src/cron/origin_tests.rs
index b6fc094dfc..0f9875e1c1 100644
--- a/crates/openhuman-core/src/cron/origin_tests.rs
+++ b/crates/openhuman-core/src/cron/origin_tests.rs
@@ -1,7 +1,7 @@
use super::*;
use crate::agent::turn_origin::{with_origin, TrustedAutomationSource};
-use {tinyflows_schedule::types::Schedule};
use serde_json::json;
+use tinyflows_schedule::types::Schedule;
fn channel_turn(history_key: Option<&str>) -> AgentTurnOrigin {
AgentTurnOrigin::ExternalChannel {
diff --git a/crates/openhuman-core/src/cron/policy_tests.rs b/crates/openhuman-core/src/cron/policy_tests.rs
index ea5b62da5c..0a24d578ff 100644
--- a/crates/openhuman-core/src/cron/policy_tests.rs
+++ b/crates/openhuman-core/src/cron/policy_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use {tinyflows_schedule::types::Schedule};
use tempfile::TempDir;
+use tinyflows_schedule::types::Schedule;
fn config(tmp: &TempDir) -> Config {
let workspace = tmp.path().join("workspace");
diff --git a/crates/openhuman-core/src/cron/scheduler.rs b/crates/openhuman-core/src/cron/scheduler.rs
index 88b82a8271..79797b499d 100644
--- a/crates/openhuman-core/src/cron/scheduler.rs
+++ b/crates/openhuman-core/src/cron/scheduler.rs
@@ -41,12 +41,12 @@ pub(crate) use slot::SchedulerSlot;
use crate::config::Config;
use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
-use {crate::cron::due_jobs, tinyflows_schedule::types::CronJob};
use crate::security::SecurityPolicy;
use anyhow::Result;
use chrono::Utc;
use std::sync::Arc;
use tokio::time::{self, Duration};
+use {crate::cron::due_jobs, tinyflows_schedule::types::CronJob};
const MIN_POLL_SECONDS: u64 = 5;
diff --git a/crates/openhuman-core/src/cron/scheduler/delivery.rs b/crates/openhuman-core/src/cron/scheduler/delivery.rs
index 6a316124c7..1c8eaae9d0 100644
--- a/crates/openhuman-core/src/cron/scheduler/delivery.rs
+++ b/crates/openhuman-core/src/cron/scheduler/delivery.rs
@@ -7,9 +7,13 @@ use super::origin_delivery::{deliver_to_origin, is_suppressed_output};
use crate::config::Config;
use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
-use {tinyflows_schedule::types::delivery_mode, tinyflows_schedule::types::CronJob, tinyflows_schedule::types::DeliveryConfig, tinyflows_schedule::types::DeliveryStatus, tinyflows_schedule::types::JobType};
use anyhow::Result;
use chrono::Utc;
+use {
+ tinyflows_schedule::types::delivery_mode, tinyflows_schedule::types::CronJob,
+ tinyflows_schedule::types::DeliveryConfig, tinyflows_schedule::types::DeliveryStatus,
+ tinyflows_schedule::types::JobType,
+};
pub(super) const MORNING_BRIEFING_AGENT_ID: &str = "morning_briefing";
pub(super) const MORNING_BRIEFING_FAILURE_NOTIFICATION: &str = "Morning briefing could not run. Check your AI provider, API key, and connected apps, then run it again from Settings > Cron Jobs.";
diff --git a/crates/openhuman-core/src/cron/scheduler/dispatch.rs b/crates/openhuman-core/src/cron/scheduler/dispatch.rs
index bb539fb600..6e4ff21151 100644
--- a/crates/openhuman-core/src/cron/scheduler/dispatch.rs
+++ b/crates/openhuman-core/src/cron/scheduler/dispatch.rs
@@ -33,8 +33,12 @@ use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
use crate::core::runtime::CoreContext;
use crate::cron::policy::policy_or_default;
-use {tinyflows_schedule::schedule::next_run_for_schedule, crate::cron::record_run, crate::cron::update_job, tinyflows_schedule::types::CronJob, tinyflows_schedule::types::CronJobPatch, tinyflows_schedule::types::Schedule};
use crate::security::SecurityPolicy;
+use {
+ crate::cron::record_run, crate::cron::update_job,
+ tinyflows_schedule::schedule::next_run_for_schedule, tinyflows_schedule::types::CronJob,
+ tinyflows_schedule::types::CronJobPatch, tinyflows_schedule::types::Schedule,
+};
/// Output recorded for a single-flight slot missed while a run was in flight.
pub(crate) const SKIPPED_OUTPUT: &str = "skipped: the previous run was still in flight";
diff --git a/crates/openhuman-core/src/cron/scheduler/failure_classification.rs b/crates/openhuman-core/src/cron/scheduler/failure_classification.rs
index a7c9fddc77..cdc924fa34 100644
--- a/crates/openhuman-core/src/cron/scheduler/failure_classification.rs
+++ b/crates/openhuman-core/src/cron/scheduler/failure_classification.rs
@@ -2,7 +2,7 @@
//! the permanent-halt predicates that stop the retry loop early.
use crate::agent::error::AgentError;
-use {tinyflows_schedule::types::JobType};
+use tinyflows_schedule::types::JobType;
pub(super) const AGENT_JOB_USER_FAILURE_MESSAGE: &str = "Something went wrong. Please try again.";
// Actionable, static failure copy for the three permanent cron halt states
diff --git a/crates/openhuman-core/src/cron/scheduler/origin_context.rs b/crates/openhuman-core/src/cron/scheduler/origin_context.rs
index f499c6adbd..8b801878fd 100644
--- a/crates/openhuman-core/src/cron/scheduler/origin_context.rs
+++ b/crates/openhuman-core/src/cron/scheduler/origin_context.rs
@@ -3,7 +3,10 @@
//! preamble saying the run is unattended.
use crate::config::Config;
-use {crate::cron::channel_bridge, tinyflows_schedule::types::CronJob, tinyflows_schedule::types::JobOrigin};
+use {
+ crate::cron::channel_bridge, tinyflows_schedule::types::CronJob,
+ tinyflows_schedule::types::JobOrigin,
+};
/// At most this many trailing messages of the origin conversation.
pub(crate) const CONTEXT_MAX_MESSAGES: usize = 10;
@@ -98,7 +101,7 @@ pub(crate) fn compose_current_prompt(job_id: &str, name: &str, prompt: &str, tai
/// plain tagged prompt; `current` and `main` get the context and preamble.
pub(crate) async fn build_run_prompt(config: &Config, job: &CronJob, name: &str) -> String {
let prompt = job.prompt.clone().unwrap_or_default();
- use {tinyflows_schedule::types::SessionTarget};
+ use tinyflows_schedule::types::SessionTarget;
match (&job.session_target, &job.origin) {
(SessionTarget::Isolated, _) => format!("[cron:{} {name}] {prompt}", job.id),
(target, origin) => {
diff --git a/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs b/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
index 4afc2397e7..7570d2955f 100644
--- a/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
+++ b/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
@@ -13,10 +13,13 @@
use super::delivery::strip_openhuman_link_markup;
use crate::config::Config;
-use {crate::cron::channel_bridge, tinyflows_schedule::types::CronJob, tinyflows_schedule::types::DeliveryStatus, tinyflows_schedule::types::JobOrigin};
use crate::web_chat::{publish_web_channel_event, WebChannelEvent};
use anyhow::{anyhow, Result};
use std::path::Path;
+use {
+ crate::cron::channel_bridge, tinyflows_schedule::types::CronJob,
+ tinyflows_schedule::types::DeliveryStatus, tinyflows_schedule::types::JobOrigin,
+};
/// What a scheduled run replies when it has nothing worth sending.
pub(crate) const NO_REPLY: &str = "NO_REPLY";
diff --git a/crates/openhuman-core/src/cron/scheduler/origin_delivery_tests.rs b/crates/openhuman-core/src/cron/scheduler/origin_delivery_tests.rs
index a166916495..0c15a1787d 100644
--- a/crates/openhuman-core/src/cron/scheduler/origin_delivery_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler/origin_delivery_tests.rs
@@ -1,10 +1,13 @@
use super::*;
-use {tinyflows_schedule::types::DeliveryConfig, tinyflows_schedule::types::JobType, tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget};
use crate::threads::store::{self as conversations, CreateConversationThread};
use tinyagents_session::transcript::{
read_transcript, resolve_keyed_transcript_path, session_stem, FileTranscriptLocator,
SessionRef, TranscriptLocator, TranscriptMessage, TranscriptMeta, TranscriptTurn,
};
+use {
+ tinyflows_schedule::types::DeliveryConfig, tinyflows_schedule::types::JobType,
+ tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget,
+};
fn config(tmp: &tempfile::TempDir) -> Config {
let config = Config {
diff --git a/crates/openhuman-core/src/cron/scheduler/retry.rs b/crates/openhuman-core/src/cron/scheduler/retry.rs
index 7f2a934474..ef43831988 100644
--- a/crates/openhuman-core/src/cron/scheduler/retry.rs
+++ b/crates/openhuman-core/src/cron/scheduler/retry.rs
@@ -8,10 +8,13 @@ use super::failure_classification::{
};
use super::shell_job::run_job_command;
use crate::config::Config;
-use {tinyflows_schedule::types::CronJob, tinyflows_schedule::types::JobType, tinyflows_schedule::types::SessionTarget};
use crate::security::SecurityPolicy;
use chrono::Utc;
use tokio::time::{self, Duration};
+use {
+ tinyflows_schedule::types::CronJob, tinyflows_schedule::types::JobType,
+ tinyflows_schedule::types::SessionTarget,
+};
pub(super) fn agent_session_target_tag(target: &SessionTarget) -> &'static str {
match target {
diff --git a/crates/openhuman-core/src/cron/scheduler/run_record.rs b/crates/openhuman-core/src/cron/scheduler/run_record.rs
index f4cb3e9ec4..ef03bbd3d6 100644
--- a/crates/openhuman-core/src/cron/scheduler/run_record.rs
+++ b/crates/openhuman-core/src/cron/scheduler/run_record.rs
@@ -3,8 +3,15 @@
use super::delivery::deliver_run;
use crate::config::Config;
-use {crate::cron::record_last_run, crate::cron::record_run_with_delivery, crate::cron::remove_job, crate::cron::reschedule_after_run, tinyflows_schedule::schedule::runs_closer_than, crate::cron::update_job, tinyflows_schedule::types::CronJob, tinyflows_schedule::types::CronJobPatch, tinyflows_schedule::types::DeliveryStatus, tinyflows_schedule::types::JobType, tinyflows_schedule::types::Schedule, tinyflows_schedule::schedule::TooFrequent, tinyflows_schedule::schedule::MIN_AGENT_JOB_INTERVAL};
use chrono::{DateTime, Utc};
+use {
+ crate::cron::record_last_run, crate::cron::record_run_with_delivery, crate::cron::remove_job,
+ crate::cron::reschedule_after_run, crate::cron::update_job,
+ tinyflows_schedule::schedule::runs_closer_than, tinyflows_schedule::schedule::TooFrequent,
+ tinyflows_schedule::schedule::MIN_AGENT_JOB_INTERVAL, tinyflows_schedule::types::CronJob,
+ tinyflows_schedule::types::CronJobPatch, tinyflows_schedule::types::DeliveryStatus,
+ tinyflows_schedule::types::JobType, tinyflows_schedule::types::Schedule,
+};
/// [`persist_job_result_for_run`] under a fresh run id.
#[cfg(test)]
diff --git a/crates/openhuman-core/src/cron/scheduler/shell_job.rs b/crates/openhuman-core/src/cron/scheduler/shell_job.rs
index 15b5be31c3..2da70ef53b 100644
--- a/crates/openhuman-core/src/cron/scheduler/shell_job.rs
+++ b/crates/openhuman-core/src/cron/scheduler/shell_job.rs
@@ -2,9 +2,9 @@
//! forbidden-path argument scan and a hard timeout.
use crate::config::Config;
-use {tinyflows_schedule::types::CronJob};
use crate::security::SecurityPolicy;
use std::process::Stdio;
+use tinyflows_schedule::types::CronJob;
use tokio::time::{self, Duration};
pub(super) const SHELL_JOB_TIMEOUT_SECS: u64 = 120;
diff --git a/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs b/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
index eec929af5e..6de113dc6e 100644
--- a/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
@@ -6,10 +6,10 @@ use super::*;
use crate::cron::policy::{set_policy, JobPolicy};
use crate::cron::system_job_handlers::{register, SystemJobContext};
use crate::cron::system_jobs::ensure_system_job;
-use {tinyflows_schedule::types::Schedule};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Duration;
use tempfile::TempDir;
+use tinyflows_schedule::types::Schedule;
fn security(config: &Config) -> Arc<SecurityPolicy> {
Arc::new(SecurityPolicy::from_config(
diff --git a/crates/openhuman-core/src/cron/scheduler_frequency_tests.rs b/crates/openhuman-core/src/cron/scheduler_frequency_tests.rs
index 467c707690..88569bd6a5 100644
--- a/crates/openhuman-core/src/cron/scheduler_frequency_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_frequency_tests.rs
@@ -1,9 +1,9 @@
use super::*;
-use {tinyflows_schedule::types::JobType};
-use {tinyflows_schedule::types::Schedule};
-use {tinyflows_schedule::schedule::TooFrequent};
-use {tinyflows_schedule::schedule::MIN_AGENT_JOB_INTERVAL};
+use tinyflows_schedule::schedule::TooFrequent;
+use tinyflows_schedule::schedule::MIN_AGENT_JOB_INTERVAL;
+use tinyflows_schedule::types::JobType;
+use tinyflows_schedule::types::Schedule;
#[tokio::test]
async fn deliver_if_configured_empty_success_skips_chat_and_alert() {
let tmp = TempDir::new().unwrap();
diff --git a/crates/openhuman-core/src/cron/scheduler_halt_and_persist_tests.rs b/crates/openhuman-core/src/cron/scheduler_halt_and_persist_tests.rs
index a6276e6124..cae5124155 100644
--- a/crates/openhuman-core/src/cron/scheduler_halt_and_persist_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_halt_and_persist_tests.rs
@@ -1,8 +1,8 @@
use super::*;
-use {tinyflows_schedule::types::JobType};
-use {tinyflows_schedule::types::Schedule};
-use {tinyflows_schedule::types::SessionTarget};
+use tinyflows_schedule::types::JobType;
+use tinyflows_schedule::types::Schedule;
+use tinyflows_schedule::types::SessionTarget;
// TAURI-RUST-514 — a BYO provider insufficient-credits 402 ("requires more
// credits") leaks from a cron-fired agent job through `last_agent_error`.
// `is_insufficient_credits_failure` must consult the message classifier so the
diff --git a/crates/openhuman-core/src/cron/scheduler_tests.rs b/crates/openhuman-core/src/cron/scheduler_tests.rs
index 1d6ed18fe0..08c16ec61e 100644
--- a/crates/openhuman-core/src/cron/scheduler_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_tests.rs
@@ -1,13 +1,15 @@
use super::*;
use crate::agent::error::AgentError;
use crate::config::Config;
-use {tinyflows_schedule::types::JobType};
-use {tinyflows_schedule::types::SessionTarget};
-use {crate::cron::self, tinyflows_schedule::types::ActiveHours, tinyflows_schedule::types::DeliveryConfig};
use crate::security::SecurityPolicy;
use chrono::{Duration as ChronoDuration, Timelike, Utc};
use std::sync::Arc;
use tempfile::TempDir;
+use tinyflows_schedule::types::JobType;
+use tinyflows_schedule::types::SessionTarget;
+use {
+ crate::cron, tinyflows_schedule::types::ActiveHours, tinyflows_schedule::types::DeliveryConfig,
+};
async fn test_config(tmp: &TempDir) -> Config {
let ws = tmp.path().join("workspace");
diff --git a/crates/openhuman-core/src/cron/schemas.rs b/crates/openhuman-core/src/cron/schemas.rs
index 5ddf048847..286d94c416 100644
--- a/crates/openhuman-core/src/cron/schemas.rs
+++ b/crates/openhuman-core/src/cron/schemas.rs
@@ -5,7 +5,7 @@ use crate::config::rpc as config_rpc;
use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
-use {tinyflows_schedule::types::CronJobPatch};
+use tinyflows_schedule::types::CronJobPatch;
fn job_id_input(comment: &'static str) -> FieldSchema {
FieldSchema {
@@ -316,13 +316,14 @@ fn handle_add(params: Map<String, Value>) -> ControllerFuture {
.get("agent_id")
.and_then(|v| v.as_str())
.map(|s| s.to_string());
- let delivery: Option<tinyflows_schedule::types::DeliveryConfig> = match params.get("delivery") {
- None | Some(Value::Null) => None,
- Some(v) => Some(
- serde_json::from_value(v.clone())
- .map_err(|e| format!("invalid 'delivery': {e}"))?,
- ),
- };
+ let delivery: Option<tinyflows_schedule::types::DeliveryConfig> =
+ match params.get("delivery") {
+ None | Some(Value::Null) => None,
+ Some(v) => Some(
+ serde_json::from_value(v.clone())
+ .map_err(|e| format!("invalid 'delivery': {e}"))?,
+ ),
+ };
let delete_after_run = params
.get("delete_after_run")
.and_then(|v| v.as_bool())
diff --git a/crates/openhuman-core/src/cron/seed.rs b/crates/openhuman-core/src/cron/seed.rs
index 18336ed9fe..c83351afec 100644
--- a/crates/openhuman-core/src/cron/seed.rs
+++ b/crates/openhuman-core/src/cron/seed.rs
@@ -18,8 +18,12 @@
//! scheduler can't double-deliver.
use crate::config::Config;
-use {crate::cron::add_agent_job_with_definition, crate::cron::dedup_named_jobs, crate::cron::list_jobs, crate::cron::remove_job, tinyflows_schedule::types::DeliveryConfig, tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget};
use anyhow::Result;
+use {
+ crate::cron::add_agent_job_with_definition, crate::cron::dedup_named_jobs,
+ crate::cron::list_jobs, crate::cron::remove_job, tinyflows_schedule::types::DeliveryConfig,
+ tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget,
+};
/// Well-known job names used to detect whether seeding has already run.
const MORNING_BRIEFING_JOB_NAME: &str = "morning_briefing";
diff --git a/crates/openhuman-core/src/cron/seed_tests.rs b/crates/openhuman-core/src/cron/seed_tests.rs
index ae042fe365..8445a5cf3e 100644
--- a/crates/openhuman-core/src/cron/seed_tests.rs
+++ b/crates/openhuman-core/src/cron/seed_tests.rs
@@ -1,7 +1,10 @@
use super::*;
-use {crate::cron::add_agent_job_with_definition, crate::cron::list_jobs, tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget};
use chrono::{Duration as ChronoDuration, Utc};
use tempfile::TempDir;
+use {
+ crate::cron::add_agent_job_with_definition, crate::cron::list_jobs,
+ tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget,
+};
fn test_config(tmp: &TempDir) -> Config {
let config = Config {
diff --git a/crates/openhuman-core/src/cron/system_jobs.rs b/crates/openhuman-core/src/cron/system_jobs.rs
index 0e253043d2..1bec8e6b97 100644
--- a/crates/openhuman-core/src/cron/system_jobs.rs
+++ b/crates/openhuman-core/src/cron/system_jobs.rs
@@ -20,7 +20,11 @@ use crate::config::Config;
use crate::memory::bus::{RETIRED_CONTEXT_REFRESH_JOB, SOURCES_SYNC_JOB};
use crate::memory::lifecycle::jobs::{BACKGROUND_INTERVAL_MINS, BACKGROUND_JOB};
-use {super::add_flow_schedule_job, super::list_jobs, super::remove_job, super::update_job, tinyflows_schedule::types::CronJob, tinyflows_schedule::types::CronJobPatch, tinyflows_schedule::types::JobType, tinyflows_schedule::types::Schedule};
+use {
+ super::add_flow_schedule_job, super::list_jobs, super::remove_job, super::update_job,
+ tinyflows_schedule::types::CronJob, tinyflows_schedule::types::CronJobPatch,
+ tinyflows_schedule::types::JobType, tinyflows_schedule::types::Schedule,
+};
/// Command prefix that marks a `flow` row as a system job.
pub const SYSTEM_COMMAND_PREFIX: &str = "system:";
diff --git a/crates/openhuman-core/src/cron/tools/add.rs b/crates/openhuman-core/src/cron/tools/add.rs
index a8ac3c9bb6..28f94475cc 100644
--- a/crates/openhuman-core/src/cron/tools/add.rs
+++ b/crates/openhuman-core/src/cron/tools/add.rs
@@ -1,13 +1,16 @@
use crate::config::Config;
use crate::cron::job_builder::{create_agent_job, AgentJobInput};
use crate::cron::origin::{current_job_origin, current_turn_may_skip_approval};
-use {crate::cron::self, tinyflows_schedule::types::DeliveryConfig, tinyflows_schedule::types::JobType, tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget};
use crate::security::SecurityPolicy;
use crate::tools::schema_cache::static_schema;
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolExposure, ToolResult};
+use {
+ crate::cron, tinyflows_schedule::types::DeliveryConfig, tinyflows_schedule::types::JobType,
+ tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget,
+};
pub struct CronAddTool {
config: Arc<Config>,
diff --git a/crates/openhuman-core/src/cron/tools/add_tests.rs b/crates/openhuman-core/src/cron/tools/add_tests.rs
index 3f5ed7ae86..96f4e5d53e 100644
--- a/crates/openhuman-core/src/cron/tools/add_tests.rs
+++ b/crates/openhuman-core/src/cron/tools/add_tests.rs
@@ -1,9 +1,9 @@
use super::*;
use crate::config::Config;
use crate::cron::job_builder::validate_delivery;
-use {tinyflows_schedule::types::ActiveHours};
use crate::security::AutonomyLevel;
use tempfile::TempDir;
+use tinyflows_schedule::types::ActiveHours;
async fn test_config(tmp: &TempDir) -> Arc<Config> {
let config = Config {
diff --git a/crates/openhuman-core/src/cron/tools/list.rs b/crates/openhuman-core/src/cron/tools/list.rs
index ab73863bbc..8b5b9c8db3 100644
--- a/crates/openhuman-core/src/cron/tools/list.rs
+++ b/crates/openhuman-core/src/cron/tools/list.rs
@@ -1,10 +1,10 @@
use crate::config::Config;
use crate::cron;
-use {tinyflows_schedule::types::CronJob};
use async_trait::async_trait;
use serde_json::json;
use std::fmt::Write as _;
use std::sync::Arc;
+use tinyflows_schedule::types::CronJob;
use tinytools::{Tool, ToolCallOptions, ToolExposure, ToolResult};
fn render_jobs_markdown(jobs: &[CronJob]) -> String {
diff --git a/crates/openhuman-core/src/cron/tools/update.rs b/crates/openhuman-core/src/cron/tools/update.rs
index d46eb444b4..f4bfaefd62 100644
--- a/crates/openhuman-core/src/cron/tools/update.rs
+++ b/crates/openhuman-core/src/cron/tools/update.rs
@@ -1,10 +1,10 @@
use crate::config::Config;
-use {crate::cron::self, tinyflows_schedule::types::CronJobPatch};
use crate::security::SecurityPolicy;
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolExposure, ToolResult};
+use {crate::cron, tinyflows_schedule::types::CronJobPatch};
pub struct CronUpdateTool {
config: Arc<Config>,
diff --git a/crates/openhuman-core/src/security/mod.rs b/crates/openhuman-core/src/security/mod.rs
index 59fbf5ffae..576aaa9088 100644
--- a/crates/openhuman-core/src/security/mod.rs
+++ b/crates/openhuman-core/src/security/mod.rs
@@ -38,8 +38,6 @@ pub use egress::{
};
pub use ops as rpc;
pub use ops::*;
-#[allow(unused_imports)]
-pub use {pairing::ensure_core_rpc_token_for_bind, pairing::is_public_bind, pairing::CoreBindTokenError, tinychannels_runtime::security::PairingGuard, pairing::CORE_TOKEN_ENV_VAR};
pub use policy::validate_path_within_root;
#[allow(unused_imports)]
pub use policy::AutonomyLevel;
@@ -51,6 +49,11 @@ pub use policy::{CommandClass, GateDecision};
#[allow(unused_imports)]
pub use policy::{TrustedAccess, TrustedRoot};
pub use policy::{POLICY_BLOCKED_MARKER, POLICY_DENIED_MARKER};
+#[allow(unused_imports)]
+pub use {
+ pairing::ensure_core_rpc_token_for_bind, pairing::is_public_bind, pairing::CoreBindTokenError,
+ pairing::CORE_TOKEN_ENV_VAR, tinychannels_runtime::security::PairingGuard,
+};
pub use schemas::{
all_controller_schemas as all_security_controller_schemas,
diff --git a/crates/openhuman-core/src/security/pairing.rs b/crates/openhuman-core/src/security/pairing.rs
index 3fc9492cdc..efda1d1c2e 100644
--- a/crates/openhuman-core/src/security/pairing.rs
+++ b/crates/openhuman-core/src/security/pairing.rs
@@ -12,9 +12,8 @@ use std::io::Write as _;
use std::os::unix::fs::OpenOptionsExt as _;
/// `PairingGuard`, `constant_time_eq`, and the pairing lockout constants now
-/// live in tinychannels (portable, self-contained); re-export them so existing
-/// callers (channels, `core::auth`, tests) keep their paths.
-pub use tinychannels_runtime::security::{
+/// live in tinychannels; consumers import their owning crate directly.
+use tinychannels_runtime::security::{
constant_time_eq, generate_code, generate_token, hash_token, is_token_hash, PairingGuard,
MAX_PAIR_ATTEMPTS, PAIR_LOCKOUT_SECS,
};
diff --git a/crates/openhuman-core/src/tools/impl/system/schedule.rs b/crates/openhuman-core/src/tools/impl/system/schedule.rs
index 46126d346e..0d72a095a7 100644
--- a/crates/openhuman-core/src/tools/impl/system/schedule.rs
+++ b/crates/openhuman-core/src/tools/impl/system/schedule.rs
@@ -1,7 +1,6 @@
use crate::config::Config;
use crate::cron::job_builder::{create_agent_job, AgentJobInput};
use crate::cron::origin::{current_job_origin, current_turn_may_skip_approval};
-use {crate::cron::self, tinyflows_schedule::types::Schedule};
use crate::security::SecurityPolicy;
use crate::tools::schema_cache::static_schema;
use anyhow::Result;
@@ -10,6 +9,7 @@ use chrono::{DateTime, Utc};
use serde_json::json;
use std::sync::Arc;
use tinytools::{PermissionLevel, Tool, ToolResult};
+use {crate::cron, tinyflows_schedule::types::Schedule};
/// Tool that lets the agent manage recurring and one-shot scheduled tasks.
pub struct ScheduleTool {
diff --git a/crates/openhuman-embed/Cargo.toml b/crates/openhuman-embed/Cargo.toml
index ba2c746954..768d52f842 100644
--- a/crates/openhuman-embed/Cargo.toml
+++ b/crates/openhuman-embed/Cargo.toml
@@ -69,6 +69,7 @@ tinymcp-bus = { path = "../../vendor/tinymcp/crates/tinymcp-bus" }
# the core's so one copy resolves.
tinyagents-session = { path = "../../vendor/tinyagents/crates/tinyagents-session" }
# Native cancellation contract, exposed unchanged by the existing stream API.
+tinybus = { path = "../../vendor/tinybus/crates/tinybus", default-features = false }
tinyagents-harness = { path = "../../vendor/tinyagents/crates/tinyagents-harness", default-features = false }
# The wire request/response types `complete` converts to; same path as the
# core's so one copy resolves.
diff --git a/crates/openhuman-embed/src/agent/approval_handler.rs b/crates/openhuman-embed/src/agent/approval_handler.rs
index 1d0fc91bfa..3e03f76f37 100644
--- a/crates/openhuman-embed/src/agent/approval_handler.rs
+++ b/crates/openhuman-embed/src/agent/approval_handler.rs
@@ -1,8 +1,8 @@
//! Callback-based approvals, using the same agent-scoped gate as polling.
use crate::{ApprovalDecision, Approvals, CancellationToken, PendingApproval};
-use {tinybus::EventHandler, tinybus::SubscriptionHandle, openhuman_core::core::bus::BUS};
use openhuman_core::core::events::DomainEvent;
use std::sync::Arc;
+use {openhuman_core::core::bus::BUS, tinybus::EventHandler, tinybus::SubscriptionHandle};
/// Decide an agent's sanitized pending permission request asynchronously.
#[async_trait::async_trait]
diff --git a/crates/openhuman-embed/src/cron.rs b/crates/openhuman-embed/src/cron.rs
index 4f9934ecc1..6151708471 100644
--- a/crates/openhuman-embed/src/cron.rs
+++ b/crates/openhuman-embed/src/cron.rs
@@ -61,7 +61,10 @@ use std::time::SystemTime;
use openhuman_core::config::Config;
use openhuman_core::cron::policy::{self, JobPolicy};
use openhuman_core::cron::system_jobs::SYSTEM_COMMAND_PREFIX;
-use {tinyflows_schedule::types::CronJob, tinyflows_schedule::types::CronJobPatch, tinyflows_schedule::types::JobType, tinyflows_schedule::types::Schedule};
+use {
+ openhuman_core::cron::CronJob, openhuman_core::cron::CronJobPatch,
+ openhuman_core::cron::JobType, openhuman_core::cron::Schedule,
+};
pub use openhuman_core::cron::system_job_handlers::SystemJobContext;
@@ -528,7 +531,7 @@ fn create(
Some(name.to_string()),
schedule,
prompt,
- tinyflows_schedule::types::SessionTarget::Isolated,
+ openhuman_core::cron::SessionTarget::Isolated,
None,
None,
false,
diff --git a/crates/openhuman-embed/src/events.rs b/crates/openhuman-embed/src/events.rs
index a5b0b60dc2..d528e8a0a8 100644
--- a/crates/openhuman-embed/src/events.rs
+++ b/crates/openhuman-embed/src/events.rs
@@ -1,7 +1,6 @@
//! Content-free runtime observations with bounded, explicit backpressure.
use futures_core::Stream;
-use {tinybus::EventHandler, tinybus::SubscriptionHandle, openhuman_core::core::bus::BUS};
use openhuman_core::core::events::DomainEvent;
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, BTreeSet};
@@ -10,6 +9,7 @@ use std::sync::{Arc, Mutex, Weak};
use std::task::{Context, Poll};
use tokio::sync::broadcast;
use tokio_stream::wrappers::{errors::BroadcastStreamRecvError, BroadcastStream};
+use {openhuman_core::core::bus::BUS, tinybus::EventHandler, tinybus::SubscriptionHandle};
/// Metadata about one runtime transition; never includes user/tool payloads.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]