( workDir: string, config: PackConfig, )
| 303 | } |
| 304 | |
| 305 | export function syncSkillDescriptions( |
| 306 | workDir: string, |
| 307 | config: PackConfig, |
| 308 | ): PackConfig { |
| 309 | const descriptionByName = new Map<string, string>(); |
| 310 | |
| 311 | for (const skill of scanInstalledSkills(workDir)) { |
| 312 | descriptionByName.set(normalizeName(skill.name), skill.description); |
| 313 | } |
| 314 | |
| 315 | config.skills = config.skills.map((skill) => { |
| 316 | const description = descriptionByName.get(normalizeName(skill.name)); |
| 317 | return description === undefined ? skill : { ...skill, description }; |
| 318 | }); |
| 319 | |
| 320 | return config; |
| 321 | } |
| 322 | |
| 323 | export function upsertSkills( |
| 324 | config: PackConfig, |
no test coverage detected