fix(desktop): 功能验证 6 项缺陷修复
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
- ISS-002: SkillInfoResponse 增加 source/path 字段,修复技能系统显示 0 个 - ISS-003: Sidebar 添加自动化/技能市场导航入口 + App 返回按钮 - ISS-004: SaaS fetchAvailableModels 添加 .catch() 防限流崩溃 - ISS-006: SaaSSettings/PricingPage 包裹 ErrorBoundary 防白屏 - ISS-008: listModels 加载 localStorage 自定义模型,修复仅显示 1 个模型 - configStore listSkills 映射添加 source/path 转发
This commit is contained in:
@@ -643,27 +643,26 @@ function createConfigClientFromKernel(client: KernelClient): ConfigStoreClient {
|
||||
const result = await client.listSkills();
|
||||
if (result?.skills) {
|
||||
return {
|
||||
skills: result.skills.map((s) => ({
|
||||
skills: result.skills.map((s: { id: string; name: string; description?: string; version: string; capabilities?: string[]; tags?: string[]; mode: string; enabled?: boolean; triggers?: string[]; category?: string; source?: string; path?: string }) => ({
|
||||
id: s.id,
|
||||
name: s.name,
|
||||
description: s.description || '',
|
||||
version: s.version,
|
||||
// Use capabilities directly
|
||||
capabilities: s.capabilities || [],
|
||||
tags: s.tags || [],
|
||||
mode: s.mode,
|
||||
// Map triggers to the expected format
|
||||
triggers: (s.triggers || []).map((t: string) => ({
|
||||
type: 'keyword',
|
||||
pattern: t,
|
||||
})),
|
||||
// Create actions from capabilities for UI display
|
||||
actions: (s.capabilities || []).map((cap: string) => ({
|
||||
type: cap,
|
||||
params: undefined,
|
||||
})),
|
||||
enabled: s.enabled ?? true,
|
||||
category: s.category,
|
||||
source: (s.source as 'builtin' | 'extra') || 'builtin',
|
||||
path: s.path || undefined,
|
||||
})),
|
||||
};
|
||||
}
|
||||
@@ -753,13 +752,27 @@ function createConfigClientFromKernel(client: KernelClient): ConfigStoreClient {
|
||||
listModels: async () => {
|
||||
try {
|
||||
const status = await client.status();
|
||||
return {
|
||||
models: status.defaultModel ? [{
|
||||
id: status.defaultModel as string,
|
||||
name: status.defaultModel as string,
|
||||
provider: (status.defaultProvider as string) || 'default',
|
||||
}] : [],
|
||||
};
|
||||
const defaultModel = status.defaultModel ? [{
|
||||
id: status.defaultModel as string,
|
||||
name: status.defaultModel as string,
|
||||
provider: (status.defaultProvider as string) || 'default',
|
||||
}] : [];
|
||||
// Load custom models from localStorage
|
||||
const customModels: Array<{ id: string; name: string; provider?: string }> = [];
|
||||
try {
|
||||
const raw = localStorage.getItem('zclaw-custom-models');
|
||||
if (raw) {
|
||||
const parsed = JSON.parse(raw);
|
||||
if (Array.isArray(parsed)) {
|
||||
for (const m of parsed) {
|
||||
if (m.id && m.name) {
|
||||
customModels.push({ id: m.id, name: m.name, provider: m.provider || 'custom' });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch { /* ignore parse errors */ }
|
||||
return { models: [...defaultModel, ...customModels] };
|
||||
} catch {
|
||||
return { models: [] };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user