(item: CloudSkillItem)
| 179 | } |
| 180 | |
| 181 | async function importFromCloud(item: CloudSkillItem): Promise<{ success: boolean; error?: string }> { |
| 182 | const mdUrl = `${CLOUD_MARKET_BASE_URL}${item.path}` |
| 183 | |
| 184 | try { |
| 185 | const mdResult = await usePlatformService().fetchRemoteConfig(mdUrl) |
| 186 | if (!mdResult.success || typeof mdResult.data !== 'string') { |
| 187 | return { success: false, error: mdResult.error || 'Failed to fetch skill content' } |
| 188 | } |
| 189 | |
| 190 | const result = await useSkillService().importFromMd(mdResult.data) |
| 191 | if (result.success) { |
| 192 | await loadSkills() |
| 193 | } |
| 194 | return result |
| 195 | } catch (error) { |
| 196 | return { success: false, error: String(error) } |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | function isCloudItemImported(id: string): boolean { |
| 201 | return skills.value.some((s) => s.id === id) |
nothing calls this directly
no test coverage detected