chore: 提交所有工作进度 — SaaS 后端增强、Admin UI、桌面端集成

包含大量 SaaS 平台改进、Admin 管理后台更新、桌面端集成完善、
文档同步、测试文件重构等内容。为 QA 测试准备干净工作树。
This commit is contained in:
iven
2026-03-29 10:46:26 +08:00
parent 9a5fad2b59
commit 5fdf96c3f5
268 changed files with 22011 additions and 3886 deletions

View File

@@ -10,7 +10,10 @@ use zclaw_types::{Result, SkillId};
use super::{Skill, SkillContext, SkillManifest, SkillMode, SkillResult};
use crate::loader;
use crate::runner::{PromptOnlySkill, ShellSkill};
use crate::runner::{PromptOnlySkill, PythonSkill, ShellSkill};
#[cfg(feature = "wasm")]
use crate::wasm_runner::WasmSkill;
/// Skill registry
pub struct SkillRegistry {
@@ -76,6 +79,26 @@ impl SkillRegistry {
.unwrap_or_else(|_| "echo 'Shell skill not configured'".to_string());
Arc::new(ShellSkill::new(manifest.clone(), cmd))
}
SkillMode::Python => {
let script_path = dir.join("main.py");
if script_path.exists() {
Arc::new(PythonSkill::new(manifest.clone(), script_path))
} else {
// Fallback to PromptOnly if no main.py found
let prompt = std::fs::read_to_string(&md_path).unwrap_or_default();
Arc::new(PromptOnlySkill::new(manifest.clone(), prompt))
}
}
#[cfg(feature = "wasm")]
SkillMode::Wasm => {
let wasm_path = dir.join("main.wasm");
if wasm_path.exists() {
Arc::new(WasmSkill::new(manifest.clone(), wasm_path)?)
} else {
let prompt = std::fs::read_to_string(&md_path).unwrap_or_default();
Arc::new(PromptOnlySkill::new(manifest.clone(), prompt))
}
}
_ => {
let prompt = std::fs::read_to_string(&md_path).unwrap_or_default();
Arc::new(PromptOnlySkill::new(manifest.clone(), prompt))