* Materialize workspace skills using the shared listSkills function.
(
workspaceId: string
)
| 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. |
no test coverage detected