use crate::platform::capabilities::PlatformCapability;
#[derive(Debug, thiserror::Error)]
pub enum HostApiError {
#[error("平台不支持该能力: {0:?}")]
UnsupportedCapability(PlatformCapability),
#[error("插件未注册: {0}")]
PluginNotRegistered(String),
#[error("图标提取失败 (请求: {request}): {reason}")]
IconExtractionFailed { request: String, reason: String },
#[error("Shell 操作失败 (目标: {target}): {reason}")]
ShellOperationFailed { target: String, reason: String },
#[error("窗口操作失败: {detail}")]
WindowOperationFailed { detail: String },
#[error("{service} 执行失败: {reason}")]
ExecutionFailed { service: String, reason: String },
#[error("路径解析失败 ({path}): {reason}")]
PathResolutionFailed { path: String, reason: String },
#[error("应用枚举失败: {reason}")]
AppEnumerationFailed { reason: String },
#[error("应用启动失败 (app_id: {app_id}): {reason}")]
AppLaunchFailed { app_id: String, reason: String },
#[error("Lnk 解析失败 ({path}): {reason}")]
LnkResolutionFailed { path: String, reason: String },
#[error("参数解析失败: {reason}")]
ParameterResolutionFailed { reason: String },
#[error("自启动操作失败: {reason}")]
AutoStartFailed { reason: String },
#[error("存储操作失败 ({file}): {reason}")]
StorageOperationFailed { file: String, reason: String },
#[error("资源未找到: {id}")]
ResourceNotFound { id: String },
#[error("路径遍历被拒绝: {path}")]
PathTraversalRejected { path: String },
}