huskies: merge 1039

This commit is contained in:
dave
2026-05-14 16:33:47 +00:00
parent 9e06fff8a8
commit 311883f45d
12 changed files with 1005 additions and 5 deletions
+8 -1
View File
@@ -2,7 +2,7 @@
use crate::agents::ReconciliationEvent;
use crate::io::watcher::WatcherEvent;
use crate::rebuild::{BotShutdownNotifier, ShutdownReason};
use crate::service::timer::TimerStore;
use crate::service::timer::{ScheduledTimerStore, TimerStore};
use crate::services::Services;
use crate::state::SessionState;
use crate::store::JsonFileStore;
@@ -74,6 +74,9 @@ pub struct AppContext {
/// spawned by the bot so that cancellations take effect in-memory rather
/// than only on disk.
pub timer_store: Arc<TimerStore>,
/// Generic scheduled-timer store for `schedule_timer` / `list_timers` /
/// `cancel_timer` MCP tools. Persists to `.huskies/scheduled_timers.json`.
pub scheduled_timer_store: Arc<ScheduledTimerStore>,
}
#[cfg(test)]
@@ -90,6 +93,9 @@ impl AppContext {
let timer_store = Arc::new(TimerStore::load(
project_root.join(".huskies").join("timers.json"),
));
let scheduled_timer_store = Arc::new(ScheduledTimerStore::load(
project_root.join(".huskies").join("scheduled_timers.json"),
));
let agents = Arc::new(AgentPool::new(3001, watcher_tx.clone()));
let services = Arc::new(Services {
project_root: project_root.clone(),
@@ -116,6 +122,7 @@ impl AppContext {
bot_shutdown: None,
matrix_shutdown_tx: None,
timer_store,
scheduled_timer_store,
}
}
}