telegram bot user isolation, config store, user context channels

This commit is contained in:
2026-07-11 01:02:37 +01:00
parent 587958ffe0
commit 5848829a92
18 changed files with 1179 additions and 426 deletions
+2 -14
View File
@@ -9,7 +9,6 @@ use serde::{Deserialize, Serialize};
use serde_json::{Value, json};
use core_api::PropertyType;
use core_api::system_bus::SystemEvent;
use skald_core::skald::Skald;
use super::ApiError;
@@ -108,20 +107,9 @@ pub async fn set_property(
return Err(ApiError::not_found("unknown config key"));
}
let old_value = skald.config().get(&p.key).await?;
// No-op if value didn't change.
if old_value.as_deref() == Some(body.value.as_str()) {
return Ok(StatusCode::OK);
}
// GlobalConfigManager::set handles the no-op check and emits
// ConfigKeyUpdated on the system bus when the value actually changes.
skald.config().set(&p.key, &body.value).await?;
skald.system_bus().send(SystemEvent::ConfigKeyUpdated {
key: p.key.clone(),
old_value,
new_value: body.value,
});
Ok(StatusCode::OK)
}
+1 -4
View File
@@ -164,12 +164,9 @@ pub async fn run_backend() -> Result<Backend> {
/// Build the plugin list. Extracted so both entry points share the same set.
fn build_plugins() -> Vec<Arc<dyn Plugin>> {
// NOTE (multi-user slice): telegram-bot, mobile-connector and honcho are
// single-user / global-ChatEventBus-subscriber plugins. They assume one user
// and cannot work under per-user isolation yet, so they are dropped from the
// build until they become multi-user-aware. See blueprint §17 and the plan.
let mut plugins: Vec<Arc<dyn Plugin>> = vec![
Arc::new(plugin_tailscale_remote::RemotePlugin::new()),
Arc::new(plugin_telegram_bot::TelegramPlugin::new()),
Arc::new(plugin_comfyui::ComfyUIPlugin::new()),
Arc::new(plugin_tts_orpheus_3b::OrpheusTtsPlugin::new()),
Arc::new(plugin_tts_kokoro::KokoroTtsPlugin::new()),