Skip to content

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

refactor(cron): migrate schedule types to tinyflows_bus

Steven Enamakel06b7ab060b93
diff --git a/crates/openhuman-core/src/cron/job_builder.rs b/crates/openhuman-core/src/cron/job_builder.rs
index 65c554431b..7c34ad0376 100644
--- a/crates/openhuman-core/src/cron/job_builder.rs
+++ b/crates/openhuman-core/src/cron/job_builder.rs
@@ -9,10 +9,10 @@
use crate::config::Config;
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_schedule::validation, tinyflows_schedule::AgentJobSpec,
+ crate::cron, tinyflows_bus::schedule::types::delivery_mode, tinyflows_bus::schedule::types::CronJob,
+ tinyflows_bus::schedule::types::DeliveryConfig, tinyflows_bus::schedule::types::JobOrigin,
+ tinyflows_bus::schedule::types::Schedule, tinyflows_bus::schedule::types::SessionTarget,
+ tinyflows_schedule::validation, tinyflows_bus::schedule::AgentJobSpec,
};
/// What an agent job creation request carries; everything defaults.
diff --git a/crates/openhuman-core/src/cron/mod.rs b/crates/openhuman-core/src/cron/mod.rs
index bfa33c3eb2..4aee520fb8 100644
--- a/crates/openhuman-core/src/cron/mod.rs
+++ b/crates/openhuman-core/src/cron/mod.rs
@@ -52,8 +52,8 @@ pub use tinyflows_schedule::schedule::{
next_run_for_schedule, normalize_expression, runs_closer_than, schedule_cron_expression,
validate_agent_schedule, validate_schedule, TooFrequent, MIN_AGENT_JOB_INTERVAL,
};
-pub use tinyflows_schedule::types::delivery_mode;
-pub use tinyflows_schedule::types::{
+pub use tinyflows_bus::schedule::types::delivery_mode;
+pub use tinyflows_bus::schedule::types::{
ActiveHours, CronJob, CronJobPatch, CronRun, DeliveryConfig, DeliveryStatus, JobOrigin,
JobType, Schedule, SessionTarget,
};
diff --git a/crates/openhuman-core/src/cron/ops.rs b/crates/openhuman-core/src/cron/ops.rs
index c6b55ddb68..43609f861d 100644
--- a/crates/openhuman-core/src/cron/ops.rs
+++ b/crates/openhuman-core/src/cron/ops.rs
@@ -5,8 +5,8 @@ use anyhow::Result;
use serde_json::json;
use {
crate::cron, crate::cron::add_shell_job, crate::cron::update_job,
- tinyflows_schedule::types::CronJob, tinyflows_schedule::types::CronJobPatch,
- tinyflows_schedule::types::CronRun, tinyflows_schedule::types::Schedule,
+ tinyflows_bus::schedule::types::CronJob, tinyflows_bus::schedule::types::CronJobPatch,
+ tinyflows_bus::schedule::types::CronRun, tinyflows_bus::schedule::types::Schedule,
};
/// Claim `job_id` as running. `None` when a run (scheduled or Run Now) already
diff --git a/crates/openhuman-core/src/cron/ops_tests.rs b/crates/openhuman-core/src/cron/ops_tests.rs
index 90835638d5..ad2f5eb71b 100644
--- a/crates/openhuman-core/src/cron/ops_tests.rs
+++ b/crates/openhuman-core/src/cron/ops_tests.rs
@@ -1,7 +1,7 @@
use super::*;
use crate::cron::get_job;
use tempfile::TempDir;
-use tinyflows_schedule::types::ActiveHours;
+use tinyflows_bus::schedule::types::ActiveHours;
fn test_config(tmp: &TempDir) -> Config {
let config = Config {
@@ -539,7 +539,7 @@ fn single_flight_system_job(config: &Config, name: &str) -> CronJob {
config,
&job.id,
CronJobPatch {
- policy: Some(tinyflows_schedule::JobPolicy {
+ policy: Some(tinyflows_bus::schedule::JobPolicy {
retries: Some(0),
single_flight: true,
}),
diff --git a/crates/openhuman-core/src/cron/origin.rs b/crates/openhuman-core/src/cron/origin.rs
index 25f8210ef6..ef8710375b 100644
--- a/crates/openhuman-core/src/cron/origin.rs
+++ b/crates/openhuman-core/src/cron/origin.rs
@@ -10,8 +10,8 @@
use crate::agent::turn_origin::{self, AgentTurnOrigin};
use serde_json::Value;
use {
- tinyflows_schedule::types::delivery_mode, tinyflows_schedule::types::CronJob,
- tinyflows_schedule::types::JobOrigin,
+ tinyflows_bus::schedule::types::delivery_mode, tinyflows_bus::schedule::types::CronJob,
+ tinyflows_bus::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 3b3e2a6c8f..0dcd8ecae1 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 serde_json::json;
-use tinyflows_schedule::types::Schedule;
+use tinyflows_bus::schedule::types::Schedule;
fn channel_turn(history_key: Option<&str>) -> AgentTurnOrigin {
AgentTurnOrigin::ExternalChannel {
@@ -92,12 +92,12 @@ fn job_with_origin(origin: Option<JobOrigin>) -> CronJob {
command: String::new(),
prompt: Some("p".into()),
name: None,
- job_type: tinyflows_schedule::types::JobType::Agent,
- session_target: tinyflows_schedule::types::SessionTarget::Current,
+ job_type: tinyflows_bus::schedule::types::JobType::Agent,
+ session_target: tinyflows_bus::schedule::types::SessionTarget::Current,
model: None,
agent_id: None,
enabled: true,
- delivery: tinyflows_schedule::types::DeliveryConfig::default(),
+ delivery: tinyflows_bus::schedule::types::DeliveryConfig::default(),
delete_after_run: false,
created_at: chrono::Utc::now(),
next_run: chrono::Utc::now(),
diff --git a/crates/openhuman-core/src/cron/scheduler.rs b/crates/openhuman-core/src/cron/scheduler.rs
index 4b2b9cc905..86261bd30d 100644
--- a/crates/openhuman-core/src/cron/scheduler.rs
+++ b/crates/openhuman-core/src/cron/scheduler.rs
@@ -48,7 +48,7 @@ use anyhow::Result;
use std::collections::HashMap;
use std::sync::Arc;
use tinyflows_schedule::runtime::{execute_with_retry, SchedulerSlot};
-use tinyflows_schedule::types::CronJob;
+use tinyflows_bus::schedule::types::CronJob;
use tokio::time::{self, Duration};
const MIN_POLL_SECONDS: u64 = 5;
diff --git a/crates/openhuman-core/src/cron/scheduler/agent_run.rs b/crates/openhuman-core/src/cron/scheduler/agent_run.rs
index 9e582933a3..5f7bc3e789 100644
--- a/crates/openhuman-core/src/cron/scheduler/agent_run.rs
+++ b/crates/openhuman-core/src/cron/scheduler/agent_run.rs
@@ -6,7 +6,7 @@ use super::failure_classification::classify_agent_anyhow_for_user;
use super::origin_context::build_run_prompt;
use crate::agent::OpenHumanSessionHost;
use crate::config::Config;
-use {tinyflows_schedule::types::CronJob, tinyflows_schedule::types::SessionTarget};
+use {tinyflows_bus::schedule::types::CronJob, tinyflows_bus::schedule::types::SessionTarget};
/// Recency window the morning briefing installs around its turn so Composio
/// task-fetch tools only surface tasks created/changed in the last day. Read
diff --git a/crates/openhuman-core/src/cron/scheduler/delivery.rs b/crates/openhuman-core/src/cron/scheduler/delivery.rs
index b41952cb2f..0c993a5d76 100644
--- a/crates/openhuman-core/src/cron/scheduler/delivery.rs
+++ b/crates/openhuman-core/src/cron/scheduler/delivery.rs
@@ -10,9 +10,9 @@ use crate::core::events::DomainEvent;
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,
+ tinyflows_bus::schedule::types::delivery_mode, tinyflows_bus::schedule::types::CronJob,
+ tinyflows_bus::schedule::types::DeliveryConfig, tinyflows_bus::schedule::types::DeliveryStatus,
+ tinyflows_bus::schedule::types::JobType,
};
pub(super) const MORNING_BRIEFING_AGENT_ID: &str = "morning_briefing";
diff --git a/crates/openhuman-core/src/cron/scheduler/executor.rs b/crates/openhuman-core/src/cron/scheduler/executor.rs
index d8d202f242..d891da6dc8 100644
--- a/crates/openhuman-core/src/cron/scheduler/executor.rs
+++ b/crates/openhuman-core/src/cron/scheduler/executor.rs
@@ -23,7 +23,7 @@ use async_trait::async_trait;
use std::collections::HashMap;
use std::sync::Mutex;
use tinyflows_schedule::runtime::{Attempt, JobExecutor};
-use tinyflows_schedule::types::{CronJob, JobType, SessionTarget};
+use tinyflows_bus::schedule::types::{CronJob, JobType, SessionTarget};
/// Run states kept before the map is cleared outright (a run whose task was
/// aborted never reaches `failed`).
diff --git a/crates/openhuman-core/src/cron/scheduler/failure_classification.rs b/crates/openhuman-core/src/cron/scheduler/failure_classification.rs
index e4b9a96176..99e9982875 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 tinyagents_harness::agent_error::AgentError;
-use tinyflows_schedule::types::JobType;
+use tinyflows_bus::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 23328ce4a3..6159244b21 100644
--- a/crates/openhuman-core/src/cron/scheduler/origin_context.rs
+++ b/crates/openhuman-core/src/cron/scheduler/origin_context.rs
@@ -5,8 +5,8 @@
use crate::config::Config;
use crate::core::runtime::DispatchCtx;
use {
- crate::cron::channel_bridge, tinyflows_schedule::types::CronJob,
- tinyflows_schedule::types::JobOrigin,
+ crate::cron::channel_bridge, tinyflows_bus::schedule::types::CronJob,
+ tinyflows_bus::schedule::types::JobOrigin,
};
/// At most this many trailing messages of the origin conversation.
@@ -112,7 +112,7 @@ pub(crate) async fn build_run_prompt(
name: &str,
) -> String {
let prompt = job.prompt.clone().unwrap_or_default();
- use tinyflows_schedule::types::SessionTarget;
+ use tinyflows_bus::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 263dfcb93b..d47b2620e6 100644
--- a/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
+++ b/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
@@ -18,8 +18,8 @@ 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,
+ crate::cron::channel_bridge, tinyflows_bus::schedule::types::CronJob,
+ tinyflows_bus::schedule::types::DeliveryStatus, tinyflows_bus::schedule::types::JobOrigin,
};
/// What a scheduled run replies when it has nothing worth sending.
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 50fdbc515a..5cf4b4eee3 100644
--- a/crates/openhuman-core/src/cron/scheduler/origin_delivery_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler/origin_delivery_tests.rs
@@ -4,8 +4,8 @@ use tinyagents_session::transcript::{
SessionRef, TranscriptMessage, TranscriptMeta, TranscriptTurn,
};
use {
- tinyflows_schedule::types::DeliveryConfig, tinyflows_schedule::types::JobType,
- tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget,
+ tinyflows_bus::schedule::types::DeliveryConfig, tinyflows_bus::schedule::types::JobType,
+ tinyflows_bus::schedule::types::Schedule, tinyflows_bus::schedule::types::SessionTarget,
};
fn config(tmp: &tempfile::TempDir) -> Config {
diff --git a/crates/openhuman-core/src/cron/scheduler/run_delivery.rs b/crates/openhuman-core/src/cron/scheduler/run_delivery.rs
index 4378591774..c7cf104e5b 100644
--- a/crates/openhuman-core/src/cron/scheduler/run_delivery.rs
+++ b/crates/openhuman-core/src/cron/scheduler/run_delivery.rs
@@ -13,7 +13,7 @@ use crate::core::events::DomainEvent;
use anyhow::Result;
use async_trait::async_trait;
use tinyflows_schedule::runtime::{Attempt, RunDelivery, TriggerSink};
-use tinyflows_schedule::types::{CronJob, DeliveryStatus};
+use tinyflows_bus::schedule::types::{CronJob, DeliveryStatus};
pub(super) struct HostDelivery {
binding: Binding,
diff --git a/crates/openhuman-core/src/cron/scheduler/shell_job.rs b/crates/openhuman-core/src/cron/scheduler/shell_job.rs
index bcfbd4cbe9..0b79049075 100644
--- a/crates/openhuman-core/src/cron/scheduler/shell_job.rs
+++ b/crates/openhuman-core/src/cron/scheduler/shell_job.rs
@@ -3,7 +3,7 @@
use crate::config::Config;
use crate::security::SecurityPolicy;
-use tinyflows_schedule::types::CronJob;
+use tinyflows_bus::schedule::types::CronJob;
use tokio::time::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 3d8305ac12..e3699cd72b 100644
--- a/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_dispatch_tests.rs
@@ -8,15 +8,15 @@ use crate::cron::system_jobs::ensure_system_job;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Duration;
use tempfile::TempDir;
-use tinyflows_schedule::types::Schedule;
-use tinyflows_schedule::JobPolicy;
+use tinyflows_bus::schedule::types::Schedule;
+use tinyflows_bus::schedule::JobPolicy;
/// Stores `policy` on the job.
fn set_policy(config: &Config, job_id: &str, policy: JobPolicy) -> anyhow::Result<()> {
cron::update_job(
config,
job_id,
- tinyflows_schedule::types::CronJobPatch {
+ tinyflows_bus::schedule::types::CronJobPatch {
policy: Some(policy),
..Default::default()
},
@@ -46,7 +46,7 @@ fn due_system_job(config: &Config, name: &str) -> CronJob {
crate::cron::update_job(
config,
&job.id,
- tinyflows_schedule::types::CronJobPatch {
+ tinyflows_bus::schedule::types::CronJobPatch {
schedule: Some(Schedule::Every {
every_ms: 3_600_000,
}),
diff --git a/crates/openhuman-core/src/cron/scheduler_frequency_tests.rs b/crates/openhuman-core/src/cron/scheduler_frequency_tests.rs
index 6cb3c2c0eb..f01e0bbbf1 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::schedule::TooFrequent;
-use tinyflows_schedule::schedule::MIN_AGENT_JOB_INTERVAL;
-use tinyflows_schedule::types::JobType;
-use tinyflows_schedule::types::Schedule;
+use tinyflows_bus::schedule::TooFrequent;
+use tinyflows_bus::schedule::MIN_AGENT_JOB_INTERVAL;
+use tinyflows_bus::schedule::types::JobType;
+use tinyflows_bus::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 1e50025499..5207069396 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,7 +1,7 @@
use super::*;
-use tinyflows_schedule::types::JobType;
-use tinyflows_schedule::types::Schedule;
+use tinyflows_bus::schedule::types::JobType;
+use tinyflows_bus::schedule::types::Schedule;
// 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
@@ -480,7 +480,7 @@ fn one_shot(config: &Config, command: &str, delete_after_run: bool) -> CronJob {
cron::update_job(
config,
&job.id,
- tinyflows_schedule::types::CronJobPatch {
+ tinyflows_bus::schedule::types::CronJobPatch {
delete_after_run: Some(true),
..Default::default()
},
diff --git a/crates/openhuman-core/src/cron/scheduler_tests.rs b/crates/openhuman-core/src/cron/scheduler_tests.rs
index f730a62316..599fa56911 100644
--- a/crates/openhuman-core/src/cron/scheduler_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_tests.rs
@@ -6,10 +6,10 @@ use chrono::{Duration as ChronoDuration, Timelike, Utc};
use std::sync::Arc;
use tempfile::TempDir;
use tinyagents_harness::agent_error::AgentError;
-use tinyflows_schedule::types::JobType;
-use tinyflows_schedule::types::SessionTarget;
+use tinyflows_bus::schedule::types::JobType;
+use tinyflows_bus::schedule::types::SessionTarget;
use {
- crate::cron, tinyflows_schedule::types::ActiveHours, tinyflows_schedule::types::DeliveryConfig,
+ crate::cron, tinyflows_bus::schedule::types::ActiveHours, tinyflows_bus::schedule::types::DeliveryConfig,
};
async fn test_config(tmp: &TempDir) -> Config {
@@ -32,7 +32,7 @@ fn test_job(command: &str) -> CronJob {
policy: Default::default(),
id: "test-job".into(),
expression: "* * * * *".into(),
- schedule: tinyflows_schedule::types::Schedule::Cron {
+ schedule: tinyflows_bus::schedule::types::Schedule::Cron {
expr: "* * * * *".into(),
tz: None,
active_hours: None,
diff --git a/crates/openhuman-core/src/cron/schemas.rs b/crates/openhuman-core/src/cron/schemas.rs
index 21b811f123..20ad57f9cf 100644
--- a/crates/openhuman-core/src/cron/schemas.rs
+++ b/crates/openhuman-core/src/cron/schemas.rs
@@ -5,7 +5,7 @@ use serde_json::{Map, Value};
use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
-use tinyflows_schedule::types::CronJobPatch;
+use tinyflows_bus::schedule::types::CronJobPatch;
fn job_id_input(comment: &'static str) -> FieldSchema {
FieldSchema {
@@ -285,7 +285,7 @@ fn handle_add(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture
Box::pin(async move {
let config = ctx.load_config().await?;
- let schedule: tinyflows_schedule::types::Schedule = read_required(&params, "schedule")?;
+ let schedule: tinyflows_bus::schedule::types::Schedule = read_required(&params, "schedule")?;
let name = params
.get("name")
.and_then(|v| v.as_str())
@@ -303,9 +303,9 @@ fn handle_add(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture
.and_then(|v| v.as_str())
.unwrap_or("isolated");
let session_target = match session_target_str {
- "main" => tinyflows_schedule::types::SessionTarget::Main,
- "isolated" => tinyflows_schedule::types::SessionTarget::Isolated,
- "current" => tinyflows_schedule::types::SessionTarget::Current,
+ "main" => tinyflows_bus::schedule::types::SessionTarget::Main,
+ "isolated" => tinyflows_bus::schedule::types::SessionTarget::Isolated,
+ "current" => tinyflows_bus::schedule::types::SessionTarget::Current,
other => return Err(format!("invalid 'session_target': {other}")),
};
let model = params
@@ -316,7 +316,7 @@ fn handle_add(ctx: DispatchCtx, 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> =
+ let delivery: Option<tinyflows_bus::schedule::types::DeliveryConfig> =
match params.get("delivery") {
None | Some(Value::Null) => None,
Some(v) => Some(
@@ -328,7 +328,7 @@ fn handle_add(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture
.get("delete_after_run")
.and_then(|v| v.as_bool())
.unwrap_or(false);
- let origin: Option<tinyflows_schedule::types::JobOrigin> = match params.get("origin") {
+ let origin: Option<tinyflows_bus::schedule::types::JobOrigin> = match params.get("origin") {
None | Some(Value::Null) => None,
Some(v) => Some(
serde_json::from_value(v.clone()).map_err(|e| format!("invalid 'origin': {e}"))?,
@@ -371,7 +371,7 @@ fn handle_add(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture
let delivery = delivery.or_else(|| {
origin
.is_none()
- .then(tinyflows_schedule::types::DeliveryConfig::default)
+ .then(tinyflows_bus::schedule::types::DeliveryConfig::default)
.or_else(|| {
Some(tinyflows_schedule::validation::default_delivery(
origin.as_ref(),
@@ -384,7 +384,7 @@ fn handle_add(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture
&delivery_cfg,
origin.as_ref(),
)?;
- let mut spec = tinyflows_schedule::AgentJobSpec::new(schedule, p);
+ let mut spec = tinyflows_bus::schedule::AgentJobSpec::new(schedule, p);
spec.name = name;
spec.session_target = session_target;
spec.model = model;
diff --git a/crates/openhuman-core/src/cron/seed.rs b/crates/openhuman-core/src/cron/seed.rs
index c83351afec..a460fca19a 100644
--- a/crates/openhuman-core/src/cron/seed.rs
+++ b/crates/openhuman-core/src/cron/seed.rs
@@ -21,8 +21,8 @@ use crate::config::Config;
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,
+ crate::cron::list_jobs, crate::cron::remove_job, tinyflows_bus::schedule::types::DeliveryConfig,
+ tinyflows_bus::schedule::types::Schedule, tinyflows_bus::schedule::types::SessionTarget,
};
/// Well-known job names used to detect whether seeding has already run.
@@ -129,7 +129,7 @@ pub fn prune_retired_jobs(config: &Config) -> Result<usize> {
/// cron entry fire alongside that would double-deliver. Best-effort:
/// log but don't fail seeding on a prune error, and scan all entries
/// because the ID is a UUID — we key on the stable `name` field.
-fn prune_legacy_welcome(config: &Config, existing: &[tinyflows_schedule::types::CronJob]) {
+fn prune_legacy_welcome(config: &Config, existing: &[tinyflows_bus::schedule::types::CronJob]) {
let stale_ids: Vec<String> = existing
.iter()
.filter(|j| j.name.as_deref() == Some(LEGACY_WELCOME_JOB_NAME))
diff --git a/crates/openhuman-core/src/cron/seed_tests.rs b/crates/openhuman-core/src/cron/seed_tests.rs
index 8445a5cf3e..d93f105eb4 100644
--- a/crates/openhuman-core/src/cron/seed_tests.rs
+++ b/crates/openhuman-core/src/cron/seed_tests.rs
@@ -3,7 +3,7 @@ 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,
+ tinyflows_bus::schedule::types::Schedule, tinyflows_bus::schedule::types::SessionTarget,
};
fn test_config(tmp: &TempDir) -> Config {
@@ -43,7 +43,7 @@ fn seeds_morning_briefing_disabled_and_idempotent() {
let jobs = list_jobs(&config).unwrap();
assert!(
jobs.iter()
- .filter(|j| matches!(j.job_type, tinyflows_schedule::types::JobType::Agent))
+ .filter(|j| matches!(j.job_type, tinyflows_bus::schedule::types::JobType::Agent))
.all(|j| !j.enabled),
"fresh onboarding seed must not create enabled billable agent cron jobs: {jobs:?}"
);
diff --git a/crates/openhuman-core/src/cron/store.rs b/crates/openhuman-core/src/cron/store.rs
index 3950bd1344..7dfdc0cfe3 100644
--- a/crates/openhuman-core/src/cron/store.rs
+++ b/crates/openhuman-core/src/cron/store.rs
@@ -12,13 +12,13 @@ use crate::config::Config;
use anyhow::Result;
use chrono::{DateTime, Utc};
use tinyflows_drivers::schedule::CronDocuments;
-use tinyflows_schedule::DeliveryStatus;
+use tinyflows_bus::schedule::DeliveryStatus;
use tinyflows_schedule::{
CronJob, CronJobPatch, CronRun, DeliveryConfig, JobType, Schedule, SessionTarget,
};
use super::limits;
-use tinyflows_schedule::AgentJobSpec;
+use tinyflows_bus::schedule::AgentJobSpec;
/// The cron database tinyflows used to write, imported on first use.
pub fn legacy_db_path(config: &Config) -> std::path::PathBuf {
diff --git a/crates/openhuman-core/src/cron/system_jobs.rs b/crates/openhuman-core/src/cron/system_jobs.rs
index 89d3ee4d3a..d3dc63b757 100644
--- a/crates/openhuman-core/src/cron/system_jobs.rs
+++ b/crates/openhuman-core/src/cron/system_jobs.rs
@@ -22,8 +22,8 @@ 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,
+ tinyflows_bus::schedule::types::CronJob, tinyflows_bus::schedule::types::CronJobPatch,
+ tinyflows_bus::schedule::types::JobType, tinyflows_bus::schedule::types::Schedule,
};
/// Command prefix that marks a `flow` row as a system job.
diff --git a/crates/openhuman-core/src/cron/tools/add.rs b/crates/openhuman-core/src/cron/tools/add.rs
index 4602758374..d9d848de2f 100644
--- a/crates/openhuman-core/src/cron/tools/add.rs
+++ b/crates/openhuman-core/src/cron/tools/add.rs
@@ -8,8 +8,8 @@ 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,
+ crate::cron, tinyflows_bus::schedule::types::DeliveryConfig, tinyflows_bus::schedule::types::JobType,
+ tinyflows_bus::schedule::types::Schedule, tinyflows_bus::schedule::types::SessionTarget,
};
pub struct CronAddTool {
diff --git a/crates/openhuman-core/src/cron/tools/add_tests.rs b/crates/openhuman-core/src/cron/tools/add_tests.rs
index 047c9d620f..949fd3de88 100644
--- a/crates/openhuman-core/src/cron/tools/add_tests.rs
+++ b/crates/openhuman-core/src/cron/tools/add_tests.rs
@@ -2,7 +2,7 @@ use super::*;
use crate::config::Config;
use crate::security::AutonomyLevel;
use tempfile::TempDir;
-use tinyflows_schedule::types::ActiveHours;
+use tinyflows_bus::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 8b5b9c8db3..8049b1c1e6 100644
--- a/crates/openhuman-core/src/cron/tools/list.rs
+++ b/crates/openhuman-core/src/cron/tools/list.rs
@@ -4,7 +4,7 @@ use async_trait::async_trait;
use serde_json::json;
use std::fmt::Write as _;
use std::sync::Arc;
-use tinyflows_schedule::types::CronJob;
+use tinyflows_bus::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 ba495b1c0b..b863328de6 100644
--- a/crates/openhuman-core/src/cron/tools/update.rs
+++ b/crates/openhuman-core/src/cron/tools/update.rs
@@ -4,7 +4,7 @@ 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};
+use {crate::cron, tinyflows_bus::schedule::types::CronJobPatch};
pub struct CronUpdateTool {
config: Arc<Config>,
diff --git a/crates/openhuman-core/src/cron/tools/update_tests.rs b/crates/openhuman-core/src/cron/tools/update_tests.rs
index 57303d22c8..f10592f6e5 100644
--- a/crates/openhuman-core/src/cron/tools/update_tests.rs
+++ b/crates/openhuman-core/src/cron/tools/update_tests.rs
@@ -110,7 +110,7 @@ fn cron_update_permission_level_is_execute() {
#[tokio::test]
async fn rejects_tightening_an_agent_job_below_five_minutes() {
- use {tinyflows_schedule::types::Schedule, tinyflows_schedule::types::SessionTarget};
+ use {tinyflows_bus::schedule::types::Schedule, tinyflows_bus::schedule::types::SessionTarget};
let tmp = TempDir::new().unwrap();
let cfg = test_config(&tmp).await;
diff --git a/crates/openhuman-core/src/flows/ops/triggers.rs b/crates/openhuman-core/src/flows/ops/triggers.rs
index bc72fcb801..1c32c8ba5c 100644
--- a/crates/openhuman-core/src/flows/ops/triggers.rs
+++ b/crates/openhuman-core/src/flows/ops/triggers.rs
@@ -93,7 +93,7 @@ pub(super) fn bind_schedule_trigger(config: &Config, flow: &Flow) {
tracing::warn!(target: "flows", flow_id = %flow.id, "[flows] schedule trigger config is missing `schedule` — cannot bind cron job");
return;
};
- let schedule: tinyflows_schedule::types::Schedule = match serde_json::from_value(schedule_raw) {
+ let schedule: tinyflows_bus::schedule::types::Schedule = match serde_json::from_value(schedule_raw) {
Ok(s) => s,
Err(e) => {
tracing::warn!(target: "flows", flow_id = %flow.id, error = %e, "[flows] invalid schedule trigger config — cannot bind cron job");
@@ -103,7 +103,7 @@ pub(super) fn bind_schedule_trigger(config: &Config, flow: &Flow) {
match crate::cron::find_flow_schedule_job(config, &flow.id) {
Ok(Some(existing)) => {
- let patch = tinyflows_schedule::types::CronJobPatch {
+ let patch = tinyflows_bus::schedule::types::CronJobPatch {
enabled: Some(true),
schedule: Some(schedule),
..Default::default()
diff --git a/crates/openhuman-core/src/tools/impl/system/schedule.rs b/crates/openhuman-core/src/tools/impl/system/schedule.rs
index 810b99dac7..1721d6b349 100644
--- a/crates/openhuman-core/src/tools/impl/system/schedule.rs
+++ b/crates/openhuman-core/src/tools/impl/system/schedule.rs
@@ -9,7 +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};
+use {crate::cron, tinyflows_bus::schedule::types::Schedule};
/// Tool that lets the agent manage recurring and one-shot scheduled tasks.
pub struct ScheduleTool {
diff --git a/crates/openhuman-embed/src/cron_tests.rs b/crates/openhuman-embed/src/cron_tests.rs
index 41bcafafe3..c2d958ddbf 100644
--- a/crates/openhuman-embed/src/cron_tests.rs
+++ b/crates/openhuman-embed/src/cron_tests.rs
@@ -13,7 +13,7 @@ fn core_job(job_type: JobType, command: &str) -> CronJob {
prompt: Some("check in".into()),
name: Some("named".into()),
job_type,
- session_target: tinyflows_schedule::types::SessionTarget::Isolated,
+ session_target: tinyflows_bus::schedule::types::SessionTarget::Isolated,
model: None,
agent_id: Some("teeny".into()),
enabled: true,
@@ -48,7 +48,7 @@ fn a_cron_schedule_drops_active_hours_it_cannot_express() {
let core = Schedule::Cron {
expr: "0 * * * *".into(),
tz: None,
- active_hours: Some(tinyflows_schedule::types::ActiveHours {
+ active_hours: Some(tinyflows_bus::schedule::types::ActiveHours {
start: "09:00".into(),
end: "17:00".into(),
}),