fix(ui): 9项端到端真实审计 — 修复记忆/技能/审计/工作区/MCP数据流断裂
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
基于 Tauri MCP 实机排查发现并修复:
1. VikingPanel: viking_ls('/') 返回0 → 改为 viking_ls('') 返回100条记忆
2. 技能列表: loadSkillsCatalog 静默失败 → 添加直接 invoke('skill_list') 回退
3. 审计日志: 面板读Gateway API无数据 → 回退读localStorage双源数据
4. 工作区: 浏览按钮无事件 → 接入prompt选择 + workspace_dir_stats 命令
5. MCP: 空列表无引导 → 添加配置文件路径提示
6. 新增 workspace_dir_stats Tauri 命令 (Rust)
排查确认正常的功能: 安全存储(OS Keyring✅), 心跳引擎(运行中✅),
定时任务(管道连通), Kernel(已初始化✅), SaaS relay模式
This commit is contained in:
@@ -17,6 +17,7 @@ pub mod orchestration;
|
||||
pub mod scheduled_task;
|
||||
pub mod skill;
|
||||
pub mod trigger;
|
||||
pub mod workspace;
|
||||
|
||||
#[cfg(feature = "multi-agent")]
|
||||
pub mod a2a;
|
||||
|
||||
43
desktop/src-tauri/src/kernel_commands/workspace.rs
Normal file
43
desktop/src-tauri/src/kernel_commands/workspace.rs
Normal file
@@ -0,0 +1,43 @@
|
||||
//! Workspace directory statistics command
|
||||
|
||||
use serde::Serialize;
|
||||
use std::path::Path;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct DirStats {
|
||||
pub file_count: u64,
|
||||
pub total_size: u64,
|
||||
}
|
||||
|
||||
/// Count files and total size in a directory (non-recursive, top-level only)
|
||||
#[tauri::command]
|
||||
pub async fn workspace_dir_stats(path: String) -> Result<DirStats, String> {
|
||||
let dir = Path::new(&path);
|
||||
if !dir.exists() {
|
||||
return Ok(DirStats {
|
||||
file_count: 0,
|
||||
total_size: 0,
|
||||
});
|
||||
}
|
||||
if !dir.is_dir() {
|
||||
return Err(format!("{} is not a directory", path));
|
||||
}
|
||||
|
||||
let mut file_count: u64 = 0;
|
||||
let mut total_size: u64 = 0;
|
||||
|
||||
let entries = std::fs::read_dir(dir).map_err(|e| format!("Failed to read dir: {}", e))?;
|
||||
for entry in entries.flatten() {
|
||||
if let Ok(metadata) = entry.metadata() {
|
||||
if metadata.is_file() {
|
||||
file_count += 1;
|
||||
total_size += metadata.len();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(DirStats {
|
||||
file_count,
|
||||
total_size,
|
||||
})
|
||||
}
|
||||
@@ -323,6 +323,8 @@ pub fn run() {
|
||||
kernel_commands::trigger::trigger_update,
|
||||
kernel_commands::trigger::trigger_delete,
|
||||
kernel_commands::trigger::trigger_execute,
|
||||
// Workspace commands
|
||||
kernel_commands::workspace::workspace_dir_stats,
|
||||
// Approval management commands
|
||||
kernel_commands::approval::approval_list,
|
||||
kernel_commands::approval::approval_respond,
|
||||
|
||||
Reference in New Issue
Block a user