refactor: remove ws-only scene routing remnants

Keep the ws branch focused on websocket and Zhihu behavior by dropping staged scene-routing artifacts and restoring single-path skills dir semantics.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
木炎
2026-04-10 22:35:43 +08:00
parent 81de162756
commit b454fa3f54
17 changed files with 107 additions and 2251 deletions

View File

@@ -12,7 +12,6 @@ use crate::runtime::RuntimeProfile;
const SGCLAW_ZEROCLAW_WORKSPACE_DIR: &str = ".sgclaw-zeroclaw-workspace";
const SKILLS_DIR_NAME: &str = "skills";
const STAGED_SKILLS_DIR_NAME: &str = "skill_staging";
pub fn build_zeroclaw_config(
workspace_root: &Path,
@@ -88,41 +87,23 @@ pub fn zeroclaw_default_skills_dir(workspace_root: &Path) -> PathBuf {
zeroclaw_workspace_dir(workspace_root).join(SKILLS_DIR_NAME)
}
pub fn resolve_skills_dir(workspace_root: &Path, settings: &DeepSeekSettings) -> Vec<PathBuf> {
resolve_skills_dir_paths(workspace_root, &settings.skills_dir)
pub fn resolve_skills_dir(workspace_root: &Path, settings: &DeepSeekSettings) -> PathBuf {
settings
.skills_dir
.as_deref()
.map(normalize_configured_skills_dir)
.unwrap_or_else(|| zeroclaw_default_skills_dir(workspace_root))
}
pub fn resolve_skills_dir_from_sgclaw_settings(
workspace_root: &Path,
settings: &SgClawSettings,
) -> Vec<PathBuf> {
resolve_skills_dir_paths(workspace_root, &settings.skills_dir)
}
pub fn resolve_scene_skills_dir_from_sgclaw_settings(
workspace_root: &Path,
settings: &SgClawSettings,
) -> Vec<PathBuf> {
resolve_skills_dir_from_sgclaw_settings(workspace_root, settings)
.into_iter()
.flat_map(|dir| {
let scene_dir = resolve_scene_skills_dir_path(dir.clone());
if scene_dir != dir {
vec![dir, scene_dir]
} else {
vec![dir]
}
})
.collect()
}
pub fn resolve_scene_skills_dir_path(skills_dir: PathBuf) -> PathBuf {
let staged_skills_dir = skills_dir.join(STAGED_SKILLS_DIR_NAME).join(SKILLS_DIR_NAME);
if staged_skills_dir.is_dir() {
staged_skills_dir
} else {
skills_dir
}
) -> PathBuf {
settings
.skills_dir
.as_deref()
.map(normalize_configured_skills_dir)
.unwrap_or_else(|| zeroclaw_default_skills_dir(workspace_root))
}
fn normalize_configured_skills_dir(configured_dir: &Path) -> PathBuf {
@@ -138,13 +119,3 @@ fn normalize_configured_skills_dir(configured_dir: &Path) -> PathBuf {
}
}
fn resolve_skills_dir_paths(workspace_root: &Path, configured_dirs: &[PathBuf]) -> Vec<PathBuf> {
if configured_dirs.is_empty() {
vec![zeroclaw_default_skills_dir(workspace_root)]
} else {
configured_dirs
.iter()
.map(|d| normalize_configured_skills_dir(d))
.collect()
}
}