story-kit: merge 275_story_matrix_bot_surfaces_claude_code_permission_prompts_to_chat

This commit is contained in:
Dave
2026-03-18 09:28:51 +00:00
parent 110815c1c5
commit 10a5bea2b1
4 changed files with 256 additions and 26 deletions

View File

@@ -167,6 +167,10 @@ async fn main() -> Result<(), std::io::Error> {
// Clone watcher_tx for the Matrix bot before it is moved into AppContext.
let watcher_tx_for_bot = watcher_tx.clone();
// Wrap perm_rx in Arc<Mutex> so it can be shared with both the WebSocket
// handler (via AppContext) and the Matrix bot.
let perm_rx = Arc::new(tokio::sync::Mutex::new(perm_rx));
let perm_rx_for_bot = Arc::clone(&perm_rx);
// Capture project root, agents Arc, and reconciliation sender before ctx
// is consumed by build_routes.
@@ -183,7 +187,7 @@ async fn main() -> Result<(), std::io::Error> {
watcher_tx,
reconciliation_tx,
perm_tx,
perm_rx: Arc::new(tokio::sync::Mutex::new(perm_rx)),
perm_rx,
};
let app = build_routes(ctx);
@@ -192,7 +196,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, watcher_tx_for_bot);
matrix::spawn_bot(root, watcher_tx_for_bot, perm_rx_for_bot);
}
// On startup: