The plugin deep link (hermes://plugin/install?catalog=) and the skill deep link are separate features: one per kind. Reverting #119381's card catalog should not leave skills without a link, so this restores the skill route on its own: - Desktop: skill-deeplink-install store, the skill route in deeplink-routes, its use-desktop-integrations wiring, and the confirm-store onConfirm/details/busy/done phases its dialog uses (restored from main with their tests). Its nine strings move from the deleted catalog.* namespace to skillDeepLink.* (en + the six locales that translated them). - Website: Skills Hub "Install in Hermes" button, plus the source-qualified installIdentifier from extract-skills.py so the link, the embedded picker and the CLI command all name the exact skill (apps/shared/src/catalog-install.ts keeps only the skill helpers). - Docs: skills.md "Install from the website" section, desktop.md pointer. The card catalog UI stays reverted.
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
/** Skill install targets shared by the public Skills Hub and Desktop's skill deep link. */
|
|
export interface SkillCatalogTarget {
|
|
name: string
|
|
source: string
|
|
identifier?: string
|
|
installIdentifier?: string
|
|
}
|
|
|
|
export function skillCatalogInstallIdentifier(skill: SkillCatalogTarget): string | null {
|
|
if (skill.installIdentifier) {
|
|
return skill.installIdentifier
|
|
}
|
|
|
|
const identifier = skill.identifier
|
|
|
|
// Older snapshots omit identifiers for local skills. Optional skills have a
|
|
// source-qualified name lookup; bundled skills are not in that source.
|
|
if (!identifier) {
|
|
return skill.source === 'built-in' ? null : skill.source === 'optional' ? `official/${skill.name}` : skill.name
|
|
}
|
|
|
|
return skill.source.toLowerCase() === 'clawhub' && !identifier.startsWith('clawhub/')
|
|
? `clawhub/${identifier}`
|
|
: identifier
|
|
}
|
|
|
|
export function skillCatalogInstallUrl(skill: SkillCatalogTarget): string | null {
|
|
const identifier = skillCatalogInstallIdentifier(skill)
|
|
|
|
return identifier ? `hermes://skill/install?${new URLSearchParams({ identifier })}` : null
|
|
}
|