Major rebranding, i18n, dashboard, shared folders, role capabilities
- Rebrand: new app/agent icons, SKALD.md, warm "paper" CSS palette (terracotta accent, --radius tokens, WCAG contrast, reduced-motion), updated favicon, tray icon, skaldkonur asset - i18n: backend crate (i18n.rs, locale column, ui_locale config), frontend library (web/lib/i18n.js, I18nMixin, t(key)), translation files (web/i18n/), every component wired - Dashboard: <dashboard-page> replaces old home-page content; <app-copilot> becomes the landing page (full/dock layout modes) - Shared folders: API endpoints (shared_folders.rs), frontend page, can_write membership, container mount topology, user_fs routing - Role capabilities: new db table & authorization seam (data not enums), roles.attrs JSON for ui_mode / interface select - Setup: skald-setup prompts for language + password, sets ui_locale - General: components migrated to CSS variables, Lit conventions cleanup, connectors/catalog/marketplace/approval refactoring
This commit is contained in:
@@ -431,7 +431,9 @@ impl ChatSessionHandler {
|
||||
let ctx = ToolContext {
|
||||
session_id: self.session_id,
|
||||
pool: Arc::clone(&self.db),
|
||||
fs: Arc::clone(&self.fs),
|
||||
// Snapshot the fs cell for the duration of this tool call — a concurrent
|
||||
// shared-folder remount swaps the cell, the next call picks it up (§6).
|
||||
fs: self.fs.load(),
|
||||
};
|
||||
self.tools.run(name, &ctx, args)
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ use crate::config::DatetimeConfig;
|
||||
use crate::db::{chat_history, chat_sessions_stack};
|
||||
use crate::events::ServerEvent;
|
||||
use core_api::message_meta::MessageMetadata;
|
||||
use core_api::user_fs::UserFs;
|
||||
use core_api::user_fs::SharedFs;
|
||||
use crate::llm::LlmManager;
|
||||
use crate::mcp::McpProvider;
|
||||
use crate::image_generate::ImageGeneratorManager;
|
||||
@@ -272,8 +272,11 @@ pub struct ChatSessionHandler {
|
||||
pub(super) user_id: String,
|
||||
/// The owner's filesystem view (home + shared folders + container), threaded
|
||||
/// into every [`ToolContext`] so disk fs-tools resolve per-user host paths and
|
||||
/// `execute_cmd` execs into the owner's container (blueprint §6).
|
||||
pub(super) fs: Arc<UserFs>,
|
||||
/// `execute_cmd` execs into the owner's container (blueprint §6). A **shared
|
||||
/// swappable cell** (not a snapshot): a shared-folder membership change is
|
||||
/// applied in place (§6 remount), so a live session picks it up on its next
|
||||
/// tool call without being rebuilt — see [`SharedFs`].
|
||||
pub(super) fs: SharedFs,
|
||||
pub(super) llm_manager: Arc<LlmManager>,
|
||||
pub(super) max_history_messages: usize,
|
||||
pub(super) max_tool_rounds: usize,
|
||||
@@ -343,7 +346,7 @@ impl ChatSessionHandler {
|
||||
db: Arc<SqlitePool>,
|
||||
shared_pool: Arc<SqlitePool>,
|
||||
user_id: String,
|
||||
fs: Arc<UserFs>,
|
||||
fs: SharedFs,
|
||||
llm_manager: Arc<LlmManager>,
|
||||
max_history_messages: usize,
|
||||
max_tool_rounds: usize,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
use core_api::user_fs::UserFs;
|
||||
use core_api::user_fs::{SharedFs, UserFs};
|
||||
|
||||
use sqlx::SqlitePool;
|
||||
use tokio::sync::Mutex;
|
||||
@@ -29,8 +29,9 @@ pub struct ChatSessionManager {
|
||||
shared_pool: Arc<SqlitePool>,
|
||||
user_id: String,
|
||||
/// The owner's filesystem view, threaded to each handler and on into every
|
||||
/// `ToolContext` (blueprint §6).
|
||||
user_fs: Arc<UserFs>,
|
||||
/// `ToolContext` (blueprint §6). A shared swappable cell so a shared-folder
|
||||
/// membership change ([`refresh_fs`](Self::refresh_fs)) reaches live sessions.
|
||||
user_fs: SharedFs,
|
||||
llm_manager: Arc<LlmManager>,
|
||||
max_history_messages: usize,
|
||||
max_tool_rounds: usize,
|
||||
@@ -60,7 +61,7 @@ impl ChatSessionManager {
|
||||
db: Arc<SqlitePool>,
|
||||
shared_pool: Arc<SqlitePool>,
|
||||
user_id: String,
|
||||
user_fs: Arc<UserFs>,
|
||||
user_fs: SharedFs,
|
||||
llm_manager: Arc<LlmManager>,
|
||||
max_history_messages: usize,
|
||||
max_tool_rounds: usize,
|
||||
@@ -171,7 +172,7 @@ impl ChatSessionManager {
|
||||
self.db.clone(),
|
||||
self.shared_pool.clone(),
|
||||
self.user_id.clone(),
|
||||
Arc::clone(&self.user_fs),
|
||||
self.user_fs.clone(),
|
||||
Arc::clone(&self.llm_manager),
|
||||
self.max_history_messages,
|
||||
self.max_tool_rounds,
|
||||
@@ -197,4 +198,12 @@ impl ChatSessionManager {
|
||||
self.active.lock().await.insert(session_id, handler.clone());
|
||||
Ok(handler)
|
||||
}
|
||||
|
||||
/// Swaps in a refreshed filesystem view for this owner (blueprint §6 remount).
|
||||
/// Every live session's handler shares the same [`SharedFs`] cell, so the new
|
||||
/// membership reaches each on its next tool call — no handler eviction, no
|
||||
/// cross-session race.
|
||||
pub fn refresh_fs(&self, fs: UserFs) {
|
||||
self.user_fs.store(fs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user