chore(desktop): Tauri 命令 @reserved 全量标注 — 88个无前端调用命令已标注
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

- 新增 66 个 @reserved 标注 (已有 22 个)
- 覆盖: agent/butler/classroom/hand/mcp/pipeline/skill/trigger/viking/zclaw 等模块
- MCP 命令增加 @connected 注释说明前端接入路径
- @reserved 总数: 89 (含 identity_init)
This commit is contained in:
iven
2026-04-15 02:05:58 +08:00
parent ee1c9ef3ea
commit 5121a3c599
24 changed files with 69 additions and 3 deletions

View File

@@ -47,6 +47,7 @@ pub struct ClassroomChatCmdRequest {
// ---------------------------------------------------------------------------
/// Send a message in the classroom chat and get multi-agent responses.
// @reserved: classroom chat functionality
// @connected
#[tauri::command]
pub async fn classroom_chat(

View File

@@ -88,6 +88,7 @@ fn stage_name(stage: &GenerationStage) -> &'static str {
/// Start classroom generation (4-stage pipeline).
/// Progress events are emitted via `classroom:progress`.
/// Supports cancellation between stages by removing the task from GenerationTasks.
// @reserved: classroom generation
// @connected
#[tauri::command]
pub async fn classroom_generate(
@@ -270,6 +271,7 @@ pub async fn classroom_cancel_generation(
}
/// Retrieve a generated classroom by ID
// @reserved: classroom generation
// @connected
#[tauri::command]
pub async fn classroom_get(

View File

@@ -52,6 +52,7 @@ pub(crate) struct ProcessLogsResponse {
}
/// Get ZCLAW Kernel status
// @reserved: system control
// @connected
#[tauri::command]
pub fn zclaw_status(app: AppHandle) -> Result<LocalGatewayStatus, String> {
@@ -59,6 +60,7 @@ pub fn zclaw_status(app: AppHandle) -> Result<LocalGatewayStatus, String> {
}
/// Start ZCLAW Kernel
// @reserved: system control
// @connected
#[tauri::command]
pub fn zclaw_start(app: AppHandle) -> Result<LocalGatewayStatus, String> {
@@ -69,6 +71,7 @@ pub fn zclaw_start(app: AppHandle) -> Result<LocalGatewayStatus, String> {
}
/// Stop ZCLAW Kernel
// @reserved: system control
// @connected
#[tauri::command]
pub fn zclaw_stop(app: AppHandle) -> Result<LocalGatewayStatus, String> {
@@ -78,6 +81,7 @@ pub fn zclaw_stop(app: AppHandle) -> Result<LocalGatewayStatus, String> {
}
/// Restart ZCLAW Kernel
// @reserved: system control
// @connected
#[tauri::command]
pub fn zclaw_restart(app: AppHandle) -> Result<LocalGatewayStatus, String> {
@@ -88,6 +92,7 @@ pub fn zclaw_restart(app: AppHandle) -> Result<LocalGatewayStatus, String> {
}
/// Get local auth token from ZCLAW config
// @reserved: system control
// @connected
#[tauri::command]
pub fn zclaw_local_auth() -> Result<LocalGatewayAuth, String> {
@@ -95,6 +100,7 @@ pub fn zclaw_local_auth() -> Result<LocalGatewayAuth, String> {
}
/// Prepare ZCLAW for Tauri (update allowed origins)
// @reserved: system control
// @connected
#[tauri::command]
pub fn zclaw_prepare_for_tauri(app: AppHandle) -> Result<LocalGatewayPrepareResult, String> {
@@ -102,6 +108,7 @@ pub fn zclaw_prepare_for_tauri(app: AppHandle) -> Result<LocalGatewayPrepareResu
}
/// Approve device pairing request
// @reserved: system control
// @connected
#[tauri::command]
pub fn zclaw_approve_device_pairing(
@@ -122,6 +129,7 @@ pub fn zclaw_doctor(app: AppHandle) -> Result<String, String> {
}
/// List ZCLAW processes
// @reserved: system control
// @connected
#[tauri::command]
pub fn zclaw_process_list(app: AppHandle) -> Result<ProcessListResponse, String> {
@@ -160,6 +168,7 @@ pub fn zclaw_process_list(app: AppHandle) -> Result<ProcessListResponse, String>
}
/// Get ZCLAW process logs
// @reserved: system control
// @connected
#[tauri::command]
pub fn zclaw_process_logs(
@@ -224,6 +233,7 @@ pub fn zclaw_process_logs(
}
/// Get ZCLAW version information
// @reserved: system control
// @connected
#[tauri::command]
pub fn zclaw_version(app: AppHandle) -> Result<VersionResponse, String> {

View File

@@ -112,6 +112,7 @@ fn get_process_uptime(status: &LocalGatewayStatus) -> Option<u64> {
}
/// Perform comprehensive health check on ZCLAW Kernel
// @reserved: system health check
// @connected
#[tauri::command]
pub fn zclaw_health_check(

View File

@@ -10,12 +10,11 @@
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use tracing::{debug, warn};
use uuid::Uuid;
use zclaw_growth::ExperienceStore;
use zclaw_types::Result;
use super::pain_aggregator::PainPoint;
use super::solution_generator::{Proposal, ProposalStatus};
use super::solution_generator::Proposal;
// ---------------------------------------------------------------------------
// Shared completion status

View File

@@ -9,7 +9,7 @@ use std::sync::Arc;
use chrono::Utc;
use tracing::{debug, warn};
use zclaw_memory::fact::{Fact, FactCategory};
use zclaw_memory::fact::Fact;
use zclaw_memory::user_profile_store::{
CommStyle, Level, UserProfile, UserProfileStore,
};

View File

@@ -121,6 +121,7 @@ pub async fn agent_a2a_delegate_task(
/// Butler delegates a user request to expert agents via the Director.
#[cfg(feature = "multi-agent")]
// @reserved: butler multi-agent delegation
// @connected
#[tauri::command]
pub async fn butler_delegate_task(

View File

@@ -68,6 +68,7 @@ pub struct AgentUpdateRequest {
// ---------------------------------------------------------------------------
/// Create a new agent
// @reserved: agent CRUD management
// @connected
#[tauri::command]
pub async fn agent_create(
@@ -150,6 +151,7 @@ pub async fn agent_create(
}
/// List all agents
// @reserved: agent CRUD management
// @connected
#[tauri::command]
pub async fn agent_list(
@@ -164,6 +166,7 @@ pub async fn agent_list(
}
/// Get agent info (with optional UserProfile from memory store)
// @reserved: agent CRUD management
// @connected
#[tauri::command]
pub async fn agent_get(

View File

@@ -89,6 +89,7 @@ pub struct StreamChatRequest {
// ---------------------------------------------------------------------------
/// Send a message to an agent
// @reserved: agent chat (desktop uses ChatStore/SaaS relay)
// @connected
#[tauri::command]
pub async fn agent_chat(

View File

@@ -112,6 +112,7 @@ impl From<zclaw_hands::HandResult> for HandResult {
///
/// Returns hands from the Kernel's HandRegistry.
/// Hands are registered during kernel initialization.
// @reserved: Hand autonomous capabilities
// @connected
#[tauri::command]
pub async fn hand_list(
@@ -142,6 +143,7 @@ pub async fn hand_list(
/// Executes a hand with the given ID and input.
/// If the hand has `needs_approval = true`, creates a pending approval instead.
/// Returns the hand result as JSON, or a pending status with approval ID.
// @reserved: Hand autonomous capabilities
// @connected
#[tauri::command]
pub async fn hand_execute(
@@ -209,6 +211,7 @@ pub async fn hand_execute(
/// When approved, the kernel's `respond_to_approval` internally spawns the Hand
/// execution. We additionally emit Tauri events so the frontend can track when
/// the execution finishes.
// @reserved: Hand approval workflow
// @connected
#[tauri::command]
pub async fn hand_approve(

View File

@@ -57,6 +57,7 @@ pub struct KernelStatusResponse {
///
/// If kernel already exists with the same config, returns existing status.
/// If config changed, reboots kernel with new config.
// @reserved: kernel lifecycle management
// @connected
#[tauri::command]
pub async fn kernel_init(

View File

@@ -82,6 +82,7 @@ pub struct McpServiceStatus {
// ────────────────────────────────────────────────────────────────
/// Start an MCP server and discover its tools
// @reserved: MCP protocol management
/// @connected — frontend: MCPServices.tsx via mcp-client.ts
#[tauri::command]
pub async fn mcp_start_service(
@@ -128,6 +129,7 @@ pub async fn mcp_start_service(
}
/// Stop an MCP server and remove its tools
// @reserved: MCP protocol management
/// @connected — frontend: MCPServices.tsx via mcp-client.ts
#[tauri::command]
pub async fn mcp_stop_service(
@@ -145,6 +147,7 @@ pub async fn mcp_stop_service(
}
/// List all active MCP services and their tools
// @reserved: MCP protocol management
/// @connected — frontend: MCPServices.tsx via mcp-client.ts
#[tauri::command]
pub async fn mcp_list_services(
@@ -177,6 +180,7 @@ pub async fn mcp_list_services(
}
/// Call an MCP tool directly
// @reserved: MCP protocol management
/// @connected — frontend: agent loop via mcp-client.ts
#[tauri::command]
pub async fn mcp_call_tool(

View File

@@ -47,6 +47,7 @@ pub struct ScheduledTaskResponse {
///
/// Tasks are automatically executed by the SchedulerService which checks
/// every 60 seconds for due triggers.
// @reserved: scheduled task management
// @connected
#[tauri::command]
pub async fn scheduled_task_create(
@@ -95,6 +96,7 @@ pub async fn scheduled_task_create(
}
/// List all scheduled tasks (kernel triggers of Schedule type)
// @reserved: scheduled task management
// @connected
#[tauri::command]
pub async fn scheduled_task_list(

View File

@@ -85,6 +85,7 @@ pub async fn skill_list(
///
/// Re-scans the skills directory for new or updated skills.
/// Optionally accepts a custom directory path to scan.
// @reserved: skill system management
// @connected
#[tauri::command]
pub async fn skill_refresh(
@@ -136,6 +137,7 @@ pub struct UpdateSkillRequest {
}
/// Create a new skill in the skills directory
// @reserved: skill system management
// @connected
#[tauri::command]
pub async fn skill_create(
@@ -184,6 +186,7 @@ pub async fn skill_create(
}
/// Update an existing skill
// @reserved: skill system management
// @connected
#[tauri::command]
pub async fn skill_update(
@@ -303,6 +306,7 @@ impl From<zclaw_skills::SkillResult> for SkillResult {
///
/// Executes a skill with the given ID and input.
/// Returns the skill result as JSON.
// @reserved: skill system management
// @connected
#[tauri::command]
pub async fn skill_execute(

View File

@@ -96,6 +96,7 @@ impl From<zclaw_kernel::trigger_manager::TriggerEntry> for TriggerResponse {
}
/// List all triggers
// @reserved: trigger management
// @connected
#[tauri::command]
pub async fn trigger_list(
@@ -110,6 +111,7 @@ pub async fn trigger_list(
}
/// Get a specific trigger
// @reserved: trigger management
// @connected
#[tauri::command]
pub async fn trigger_get(
@@ -127,6 +129,7 @@ pub async fn trigger_get(
}
/// Create a new trigger
// @reserved: trigger management
// @connected
#[tauri::command]
pub async fn trigger_create(
@@ -182,6 +185,7 @@ pub async fn trigger_create(
}
/// Update a trigger
// @reserved: trigger management
// @connected
#[tauri::command]
pub async fn trigger_update(
@@ -227,6 +231,7 @@ pub async fn trigger_delete(
}
/// Execute a trigger manually
// @reserved: trigger management
// @connected
#[tauri::command]
pub async fn trigger_execute(

View File

@@ -10,6 +10,7 @@ pub struct DirStats {
}
/// Count files and total size in a directory (non-recursive, top-level only)
// @reserved: workspace statistics
#[tauri::command]
pub async fn workspace_dir_stats(path: String) -> Result<DirStats, String> {
let dir = Path::new(&path);

View File

@@ -453,6 +453,7 @@ impl EmbeddingClient {
}
}
// @reserved: embedding vector generation
// @connected
#[tauri::command]
pub async fn embedding_create(
@@ -473,6 +474,7 @@ pub async fn embedding_create(
client.embed(&text).await
}
// @reserved: embedding provider listing
// @connected
#[tauri::command]
pub async fn embedding_providers() -> Result<Vec<(String, String, String, usize)>, String> {

View File

@@ -473,6 +473,7 @@ If no significant memories found, return empty array: []"#,
// === Tauri Commands ===
// @reserved: memory extraction
// @connected
#[tauri::command]
pub async fn extract_session_memories(
@@ -490,6 +491,7 @@ pub async fn extract_session_memories(
/// Extract memories from session and store to SqliteStorage
/// This combines extraction and storage in one command
// @reserved: memory extraction and storage
// @connected
#[tauri::command]
pub async fn extract_and_store_memories(

View File

@@ -55,6 +55,7 @@ pub struct WorkflowStepInput {
}
/// Create a new pipeline as a YAML file
// @reserved: pipeline workflow management
// @connected
#[tauri::command]
pub async fn pipeline_create(
@@ -180,6 +181,7 @@ pub async fn pipeline_create(
}
/// Update an existing pipeline
// @reserved: pipeline workflow management
// @connected
#[tauri::command]
pub async fn pipeline_update(

View File

@@ -20,6 +20,7 @@ use super::helpers::{get_pipelines_directory, scan_pipelines_with_paths, scan_pi
use crate::kernel_commands::KernelState;
/// Discover and list all available pipelines
// @reserved: pipeline workflow management
// @connected
#[tauri::command]
pub async fn pipeline_list(
@@ -70,6 +71,7 @@ pub async fn pipeline_list(
}
/// Get pipeline details
// @reserved: pipeline workflow management
// @connected
#[tauri::command]
pub async fn pipeline_get(
@@ -85,6 +87,7 @@ pub async fn pipeline_get(
}
/// Run a pipeline
// @reserved: pipeline workflow management
// @connected
#[tauri::command]
pub async fn pipeline_run(
@@ -197,6 +200,7 @@ pub async fn pipeline_run(
}
/// Get pipeline run progress
// @reserved: pipeline workflow management
// @connected
#[tauri::command]
pub async fn pipeline_progress(
@@ -234,6 +238,7 @@ pub async fn pipeline_cancel(
}
/// Get pipeline run result
// @reserved: pipeline workflow management
// @connected
#[tauri::command]
pub async fn pipeline_result(
@@ -261,6 +266,7 @@ pub async fn pipeline_result(
}
/// List all runs
// @reserved: pipeline workflow management
// @connected
#[tauri::command]
pub async fn pipeline_runs(
@@ -287,6 +293,7 @@ pub async fn pipeline_runs(
}
/// Refresh pipeline discovery
// @reserved: pipeline workflow management
// @connected
#[tauri::command]
pub async fn pipeline_refresh(

View File

@@ -62,6 +62,7 @@ pub struct PipelineCandidateInfo {
}
/// Route user input to matching pipeline
// @reserved: semantic intent routing
// @connected
#[tauri::command]
pub async fn route_intent(

View File

@@ -9,6 +9,7 @@ use super::types::PipelineInputInfo;
use super::PipelineState;
/// Analyze presentation data
// @reserved: presentation analysis
// @connected
#[tauri::command]
pub async fn analyze_presentation(

View File

@@ -32,6 +32,7 @@ pub fn secure_store_set(key: String, value: String) -> Result<(), String> {
}
/// Retrieve a value from the OS keyring
// @reserved: secure storage access
// @connected
#[tauri::command]
pub fn secure_store_get(key: String) -> Result<String, String> {
@@ -81,6 +82,7 @@ pub fn secure_store_delete(key: String) -> Result<(), String> {
}
/// Check if secure storage is available on this platform
// @reserved: secure storage access
// @connected
#[tauri::command]
pub fn secure_store_is_available() -> bool {

View File

@@ -150,6 +150,7 @@ fn get_data_dir_string() -> Option<String> {
// === Tauri Commands ===
/// Check if memory storage is available
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_status() -> Result<VikingStatus, String> {
@@ -178,6 +179,7 @@ pub async fn viking_status() -> Result<VikingStatus, String> {
}
/// Add a memory entry
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_add(uri: String, content: String) -> Result<VikingAddResult, String> {
@@ -201,6 +203,7 @@ pub async fn viking_add(uri: String, content: String) -> Result<VikingAddResult,
}
/// Add a memory with metadata
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_add_with_metadata(
@@ -232,6 +235,7 @@ pub async fn viking_add_with_metadata(
}
/// Find memories by semantic search
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_find(
@@ -278,6 +282,7 @@ pub async fn viking_find(
}
/// Grep memories by pattern (uses FTS5)
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_grep(
@@ -332,6 +337,7 @@ pub async fn viking_grep(
}
/// List memories at a path
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_ls(path: String) -> Result<Vec<VikingResource>, String> {
@@ -360,6 +366,7 @@ pub async fn viking_ls(path: String) -> Result<Vec<VikingResource>, String> {
}
/// Read memory content
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_read(uri: String, level: Option<String>) -> Result<String, String> {
@@ -404,6 +411,7 @@ pub async fn viking_read(uri: String, level: Option<String>) -> Result<String, S
}
/// Remove a memory
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_remove(uri: String) -> Result<(), String> {
@@ -418,6 +426,7 @@ pub async fn viking_remove(uri: String) -> Result<(), String> {
}
/// Get memory tree
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_tree(path: String, depth: Option<usize>) -> Result<serde_json::Value, String> {
@@ -469,6 +478,7 @@ pub async fn viking_tree(path: String, depth: Option<usize>) -> Result<serde_jso
}
/// Inject memories into prompt (for agent loop integration)
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_inject_prompt(
@@ -611,6 +621,7 @@ pub async fn viking_configure_summary_driver(
}
/// Store a memory and optionally generate L0/L1 summaries in the background
// @reserved: VikingStorage persistence
// @connected
#[tauri::command]
pub async fn viking_store_with_summaries(