refactor(backend): alihkan Settings ke zesdex-cms JsonSettingsRepository
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
6d41ffc587
commit
8e6acc30d5
@@ -3,7 +3,7 @@
|
||||
//! Flow: exposes small mutation functions (currently just cycling the
|
||||
//! internet access mode) invoked by keybindings while the settings overlay
|
||||
//! is active.
|
||||
use crate::model::settings::{InternetMode, Settings};
|
||||
use zesdex_cms::domain::settings::{InternetMode, Settings};
|
||||
|
||||
/// Advance the internet access mode to the next value in the cycle.
|
||||
///
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
//! displayed "?" on no match instead of falling back like the other two,
|
||||
//! an inconsistency this unifies away).
|
||||
use crate::model::app_config::AppConfig;
|
||||
use crate::model::settings::Settings;
|
||||
use zesdex_cms::domain::settings::Settings;
|
||||
|
||||
/// Resolve the context-window size (in tokens) for the currently
|
||||
/// configured provider/model.
|
||||
|
||||
@@ -17,7 +17,9 @@ use crate::app::mcp::manager::McpManager;
|
||||
use crate::app::workflow::engine::WorkflowEngine;
|
||||
use crate::model::app_config::AppConfig;
|
||||
use crate::model::editlog::EditLog;
|
||||
use crate::model::settings::Settings;
|
||||
use zesdex_cms::domain::repository::SettingsRepository;
|
||||
use zesdex_cms::domain::settings::Settings;
|
||||
use zesdex_cms::infrastructure::persistence::settings_repo::JsonSettingsRepository;
|
||||
|
||||
/// A single transcript entry rendered in the TUI chat pane.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
@@ -86,7 +88,10 @@ impl AppStateRest {
|
||||
/// no parent, and to an empty session id when the dir name can't be
|
||||
/// read, so construction never fails.
|
||||
pub fn new(workspace_roots: Vec<PathBuf>, session_dir: &std::path::Path, memory_dir: PathBuf) -> Self {
|
||||
let settings = Settings::load();
|
||||
let store_base_dir = zesdex_entities::seaorm::common::store::Store::new().base_dir;
|
||||
let settings = JsonSettingsRepository::new()
|
||||
.load(&store_base_dir)
|
||||
.unwrap_or_default();
|
||||
let app_config = AppConfig::load();
|
||||
let worktrees_dir = memory_dir.parent().unwrap_or_else(|| {
|
||||
tracing::warn!("[state] memory_dir '{}' has no parent, using it for worktrees", memory_dir.display());
|
||||
|
||||
@@ -15,6 +15,7 @@ use crate::dto::provider::request::ToolDef;
|
||||
use crate::tool::{all_tools, tool_defs, tool_is_risky};
|
||||
use super::context::SubagentContext;
|
||||
use super::event::SubagentEvent;
|
||||
use zesdex_cms::domain::repository::SettingsRepository;
|
||||
|
||||
/// Maps a subagent's allowed tool names to concrete Tool trait objects and
|
||||
/// OpenAI-style tool definitions.
|
||||
@@ -58,7 +59,10 @@ fn build_subagent_tools(allowed_tools: &[String]) -> (Vec<Box<dyn crate::tool::T
|
||||
/// is empty when every resolution path was exhausted — callers must check
|
||||
/// for this before issuing requests (see `run_subagent`).
|
||||
fn resolve_provider_config() -> (String, String, Option<String>, String) {
|
||||
let settings = crate::model::settings::Settings::load();
|
||||
let store_base_dir = zesdex_entities::seaorm::common::store::Store::new().base_dir;
|
||||
let settings = zesdex_cms::infrastructure::persistence::settings_repo::JsonSettingsRepository::new()
|
||||
.load(&store_base_dir)
|
||||
.unwrap_or_default();
|
||||
let app_config = crate::model::app_config::AppConfig::load();
|
||||
|
||||
let mut api_key = settings.api_keys.get(&settings.provider).cloned().unwrap_or_else(|| {
|
||||
|
||||
@@ -33,6 +33,7 @@ use std::sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc, Mutex,
|
||||
};
|
||||
use zesdex_cms::domain::repository::SettingsRepository;
|
||||
|
||||
/// One directive the Hive's Core Intelligence issues to a drone within a
|
||||
/// cognitive cycle. A drone's sole identity is its directive and access tier.
|
||||
@@ -278,7 +279,10 @@ pub fn run_hive_mind(
|
||||
anyhow::bail!("the Hive received no cognitive cycles to execute");
|
||||
}
|
||||
|
||||
let settings = crate::model::settings::Settings::load();
|
||||
let store_base_dir = zesdex_entities::seaorm::common::store::Store::new().base_dir;
|
||||
let settings = zesdex_cms::infrastructure::persistence::settings_repo::JsonSettingsRepository::new()
|
||||
.load(&store_base_dir)
|
||||
.unwrap_or_default();
|
||||
let node_timeout_ms = Some(settings.hive_mind_node_timeout_ms);
|
||||
let max_cycle_concurrency = settings.workflow_max_concurrency.max(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user