MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / importFromCloud

Function importFromCloud

src/stores/skill.ts:181–198  ·  view source on GitHub ↗
(item: CloudSkillItem)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 5

usePlatformServiceFunction · 0.90
useSkillServiceFunction · 0.90
loadSkillsFunction · 0.85
fetchRemoteConfigMethod · 0.65
importFromMdMethod · 0.65

Tested by

no test coverage detected