story-kit: merge 261_story_bot_notifications_when_stories_move_between_stages

This commit is contained in:
Dave
2026-03-17 14:03:08 +00:00
parent a067091354
commit a4affca9be
4 changed files with 329 additions and 4 deletions

View File

@@ -167,6 +167,9 @@ async fn main() -> Result<(), std::io::Error> {
// Permission channel: MCP prompt_permission → WebSocket handler.
let (perm_tx, perm_rx) = tokio::sync::mpsc::unbounded_channel();
// Clone watcher_tx for the Matrix bot before it is moved into AppContext.
let watcher_tx_for_bot = watcher_tx.clone();
// Capture project root, agents Arc, and reconciliation sender before ctx
// is consumed by build_routes.
let startup_root: Option<PathBuf> = app_state.project_root.lock().unwrap().clone();
@@ -191,7 +194,7 @@ async fn main() -> Result<(), std::io::Error> {
// Optional Matrix bot: connect to the homeserver and start listening for
// messages if `.story_kit/bot.toml` is present and enabled.
if let Some(ref root) = startup_root {
matrix::spawn_bot(root);
matrix::spawn_bot(root, watcher_tx_for_bot);
}
// On startup: