MCPcopy
hub / github.com/simstudioai/sim / materializeSkills

Method materializeSkills

apps/sim/lib/copilot/vfs/workspace-vfs.ts:1845–1873  ·  view source on GitHub ↗

* Materialize workspace skills using the shared listSkills function.

(
    workspaceId: string
  )

Source from the content-addressed store, hash-verified

1843 * Materialize workspace skills using the shared listSkills function.
1844 */
1845 private async materializeSkills(
1846 workspaceId: string
1847 ): Promise<NonNullable<WorkspaceMdData['skills']>> {
1848 try {
1849 const skillRows = await listSkills({ workspaceId, includeBuiltins: false })
1850
1851 for (const s of skillRows) {
1852 const safeName = sanitizeName(s.name)
1853 this.files.set(
1854 `agent/skills/${safeName}.json`,
1855 serializeSkill({
1856 id: s.id,
1857 name: s.name,
1858 description: s.description,
1859 content: s.content,
1860 createdAt: s.createdAt,
1861 })
1862 )
1863 }
1864
1865 return skillRows.map((s) => ({ id: s.id, name: s.name, description: s.description }))
1866 } catch (err) {
1867 logger.warn('Failed to materialize skills', {
1868 workspaceId,
1869 error: toError(err).message,
1870 })
1871 return []
1872 }
1873 }
1874
1875 /**
1876 * Materialize mothership task chats as browsable conversation files.

Callers 1

materializeMethod · 0.95

Calls 6

listSkillsFunction · 0.90
serializeSkillFunction · 0.90
toErrorFunction · 0.90
sanitizeNameFunction · 0.70
setMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected