The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): keep the hermes://skill/install deep link through the catalog revert
teknium183097ba0082e
diff --git a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.test.tsx b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.test.tsxindex 51e32d5bede..b986fade191 100644--- a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.test.tsx+++ b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.test.tsx@@ -1,9 +1,12 @@-import { renderHook, waitFor } from '@testing-library/react'+import { act, renderHook, waitFor } from '@testing-library/react'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'import { registerTerminalContextMenu } from '@/app/right-sidebar/terminal/terminal-context-menu'+import { setApiRequestConnection, setApiRequestProfile } from '@/hermes'import { createClientSessionState } from '@/lib/chat-runtime'import { adoptNewSessionDraft, stashSessionDraft, takeSessionDraft } from '@/store/composer'+import { $confirmRequest, runConfirm, settleConfirm } from '@/store/confirm'+import { $hubInstalledOverride } from '@/store/hub-actions'import { requestMcpInstallFromDeepLink } from '@/store/mcp-deeplink-install'import { requestPluginCatalogInstallFromDeepLink } from '@/store/plugin-catalog-install'import { openPluginInstallRequest } from '@/store/plugin-install-request'@@ -70,6 +73,8 @@ describe('useDesktopIntegrations', () => {window.localStorage.clear()_resetLegacyDiscardForTests()vi.mocked(requestMcpInstallFromDeepLink).mockClear()+ vi.mocked(requestPluginCatalogInstallFromDeepLink).mockClear()+ vi.mocked(openPluginInstallRequest).mockClear()navigate = vi.fn()// Every test starts as a main window; only the HUD describe flips this.hudWindowMock.mockReturnValue(false)@@ -658,7 +663,7 @@ describe('useDesktopIntegrations', () => {render({ profileReady: true, sessions })- // /skills is not a session route — no ownership validation needed.+ // /capabilities is not a session route — no ownership validation needed.expect(navigate).toHaveBeenCalledWith('/capabilities', { replace: true })})@@ -823,6 +828,111 @@ describe('useDesktopIntegrations', () => {})})+ describe('catalog install deep links', () => {+ function listen() {+ render({ profileReady: true, resumeLastSession: false })++ return vi.mocked(window.hermesDesktop.onDeepLink!).mock.calls[0]![0]+ }++ afterEach(() => {+ settleConfirm(false)+ $hubInstalledOverride.set({})+ setApiRequestConnection(null)+ setApiRequestProfile(null)+ })++ it('opens repository confirmation without trusting catalog metadata from the link', () => {+ const deepLink = listen()+ const params = { repo: 'owner/repo#plugin', catalog_name: 'catalog-plugin', sha: 'display-pin' }+ deepLink({ kind: 'plugin', name: 'install', params })++ expect(openPluginInstallRequest).toHaveBeenCalledExactlyOnceWith({+ repo: params.repo,+ enable: true,+ force: false,+ legacyHint: null+ })+ expect(requestPluginCatalogInstallFromDeepLink).not.toHaveBeenCalled()+ expect(navigate).not.toHaveBeenCalled()+ })++ it('requires skill confirmation, preserves the request scope, and uses the hub pipeline', async () => {+ const api = vi.fn(async (request: { path: string }) => {+ if (request.path === '/api/skills/hub/install') {+ return { name: 'skill-link-test' }+ }++ if (request.path.startsWith('/api/actions/skill-link-test/')) {+ return { name: 'skill-link-test', running: false, exit_code: 0, lines: ['Installed'], pid: 123 }+ }++ return {}+ })++ desktopWindow.hermesDesktop = { ...desktopWindow.hermesDesktop, api } as unknown as Window['hermesDesktop']+ const deepLink = listen()+ const installs = () => api.mock.calls.filter(([r]) => r.path === '/api/skills/hub/install')+ const identifier = 'skills-sh/owner/repo/skill'+ const payload = { kind: 'skill', name: 'install', params: { identifier } }++ for (const [connection, profile] of [+ ['server-a', 'research'],+ ['server-b', 'work'],+ ['server-a', 'research']+ ]) {+ setApiRequestConnection(connection)+ setApiRequestProfile(profile)+ api.mockClear()+ $hubInstalledOverride.set({})+ act(() => deepLink(payload))+ expect($confirmRequest.get()?.title).toBe('Install “skill”?')+ expect($confirmRequest.get()?.details).toEqual([+ { label: 'Source', value: identifier },+ { label: 'Install to', value: `${connection} · ${profile}` }+ ])+ expect(installs()).toHaveLength(0)+ await act(async () => settleConfirm(false))+ expect(installs()).toHaveLength(0)++ act(() => deepLink(payload))+ await act(async () => runConfirm($confirmRequest.get()!))+ expect($confirmRequest.get()?.phase).toBe('done')+ settleConfirm(true)+ await waitFor(() => expect($hubInstalledOverride.get()[identifier]).toBe(true))+ expect(installs()).toEqual([+ [+ {+ connectionId: connection,+ profile,+ priority: 'foreground',+ path: '/api/skills/hub/install',+ method: 'POST',+ body: { identifier }+ }+ ]+ ])+ expect(api).toHaveBeenCalledWith({+ connectionId: connection,+ profile,+ priority: 'foreground',+ path: '/api/actions/skill-link-test/status?lines=200'+ })+ }++ api.mockClear()+ act(() => deepLink(payload))+ setApiRequestConnection('server-b')+ setApiRequestProfile('work')+ await expect(runConfirm($confirmRequest.get()!)).rejects.toThrow('The destination changed')+ settleConfirm(false)+ expect(installs()).toHaveLength(0)+ act(() => deepLink({ kind: 'skill', name: 'install', params: {} }))+ expect($confirmRequest.get()).toBeNull()+ expect(navigate).not.toHaveBeenCalled()+ })+ })+describe('notification click -> focus-session id translation', () => {function withFocusSession(): (sessionId: string) => void {let handler: ((sessionId: string) => void) | undefineddiff --git a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.tsindex d7e208313a4..9237c642d5a 100644--- a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts+++ b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts@@ -37,6 +37,7 @@ import {} from '@/store/session'import { $botChatScopes, $sessionTiles, storedSessionIdForRuntimeId } from '@/store/session-states'import { onSessionsChanged } from '@/store/session-sync'+import { requestSkillInstallFromDeepLink } from '@/store/skill-deeplink-install'import { openUpdatesWindow, startUpdatePoller, stopUpdatePoller } from '@/store/updates'import { isBrowserWindow, isHudWindow, isPeerInstanceWindow, isSecondaryWindow } from '@/store/windows'import type { SessionInfo } from '@/types/hermes'@@ -378,6 +379,7 @@ export function useDesktopIntegrations({// names toast an error and never fall back to a git-path install.// - plugin/install?… (and legacy plugin-agent/plugin-desktop) → plugin install// modal awaiting explicit confirmation. Never auto-installs.+ // - skill/install?identifier=… → confirmation, then the existing hub pipeline// - blueprint/<name>?… → reviewable /blueprint command in the composer// - <plugin>/<path>?… → in-app navigate (e.g. index-network/intent/1)// - open/<path>?… → in-app navigate (generic)@@ -446,6 +448,16 @@ export function useDesktopIntegrations({return}+ if (action.type === 'skill-install') {+ void requestSkillInstallFromDeepLink(action.identifier)++ return+ }++ if (payload.kind === 'skill') {+ return+ }+// Not a core action — treat as a plugin-scoped or open/ navigation deep// link (hermes://index-network/intent/1, hermes://open/…). The resolver// rejects reserved kinds and unsafe paths.diff --git a/apps/desktop/src/components/confirm-host.test.tsx b/apps/desktop/src/components/confirm-host.test.tsxindex 0aeff59273e..99aee7e4fd5 100644--- a/apps/desktop/src/components/confirm-host.test.tsx+++ b/apps/desktop/src/components/confirm-host.test.tsx@@ -64,6 +64,45 @@ describe('confirm()', () => {expect(read()).toBe(false)})+ it('keeps async actions open through progress, inline failure, retry and completion', async () => {+ render(<ConfirmHost />)+ let fail!: (error: Error) => void+ let finish!: () => void+ let attempts = 0+ let answer: boolean | undefined++ const pending = confirm({+ title: 'Install “pdf”?',+ confirmLabel: 'Install',+ busyLabel: 'Installing…',+ doneLabel: 'Installed',+ details: [{ label: 'Source', value: 'official/productivity/pdf' }],+ onConfirm: () =>+ new Promise<void>((resolve, reject) => {+ attempts += 1+ finish = resolve+ fail = reject+ })+ }).then(value => {+ answer = value+ })++ expect(await screen.findByText('official/productivity/pdf')).toBeTruthy()+ fireEvent.click(screen.getByRole('button', { name: 'Install' }))+ expect(await screen.findByRole('button', { name: 'Installing…' })).toBeTruthy()+ expect(answer).toBeUndefined()+ expect(await confirm({ title: 'Must not interrupt' })).toBe(false)+ await act(async () => fail(new Error('Network unavailable')))+ expect(await screen.findByText('Network unavailable')).toBeTruthy()+ fireEvent.click(screen.getByRole('button', { name: 'Install' }))+ await act(async () => finish())+ expect(await screen.findByRole('button', { name: 'Installed' })).toBeTruthy()+ await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull())+ await pending+ expect(answer).toBe(true)+ expect(attempts).toBe(2)+ })+it('supersedes an open request, answering the one it replaces no', async () => {render(<ConfirmHost />)diff --git a/apps/desktop/src/components/confirm-host.tsx b/apps/desktop/src/components/confirm-host.tsxindex 2b6f8752b97..02446f70d04 100644--- a/apps/desktop/src/components/confirm-host.tsx+++ b/apps/desktop/src/components/confirm-host.tsx@@ -2,7 +2,7 @@ import { useStore } from '@nanostores/react'import { useEffect, useState } from 'react'import { ConfirmDialog } from '@/components/ui/confirm-dialog'-import { $confirmRequest, type PendingConfirm, settleConfirm } from '@/store/confirm'+import { $confirmRequest, type PendingConfirm, runConfirm, settleConfirm } from '@/store/confirm'// The one mount point for `confirm()` from @/store/confirm. Mounted once at the// shell, the way NotificationStack backs notify().@@ -24,17 +24,29 @@ export function ConfirmHost() {return (<ConfirmDialog+ busyLabel={shown.busyLabel}cancelLabel={shown.cancelLabel}confirmLabel={shown.confirmLabel}description={shown.description}destructive={shown.destructive}- // The caller does the work once it has its answer, so there is nothing- // here to keep the dialog open for.- dismissOnConfirm- onClose={() => settleConfirm(false)}- onConfirm={() => settleConfirm(true)}+ dismissOnConfirm={!shown.onConfirm}+ doneLabel={shown.doneLabel}+ key={shown.id}+ onClose={() => settleConfirm(shown.phase === 'done', shown)}+ onConfirm={() => runConfirm(shown)}open={request !== null}title={shown.title}- />+ >+ {shown.details && (+ <dl className="space-y-3 text-xs">+ {shown.details.map(({ label, value }) => (+ <div className="grid grid-cols-[5rem_minmax(0,1fr)] gap-3" key={label}>+ <dt className="text-muted-foreground">{label}</dt>+ <dd className="m-0 whitespace-pre-wrap break-words text-foreground">{value}</dd>+ </div>+ ))}+ </dl>+ )}+ </ConfirmDialog>)}diff --git a/apps/desktop/src/components/ui/confirm-dialog.tsx b/apps/desktop/src/components/ui/confirm-dialog.tsxindex fc166efd439..37f5a904617 100644--- a/apps/desktop/src/components/ui/confirm-dialog.tsx+++ b/apps/desktop/src/components/ui/confirm-dialog.tsx@@ -21,6 +21,7 @@ interface ConfirmDialogProps {onConfirm: () => Promise<void> | voidtitle: ReactNodedescription?: ReactNode+ children?: ReactNodeconfirmLabel?: stringbusyLabel?: stringdoneLabel?: string@@ -48,6 +49,7 @@ export function ConfirmDialog({onConfirm,title,description,+ children,confirmLabel,busyLabel,doneLabel,@@ -153,6 +155,7 @@ export function ConfirmDialog({{description ? <DialogDescription className="whitespace-pre-line">{description}</DialogDescription> : null}</DialogHeader>+ {children}{error && (<div className="flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive"><AlertTriangle className="mt-0.5 size-3.5 shrink-0" />diff --git a/apps/desktop/src/i18n/ar_capabilities.ts b/apps/desktop/src/i18n/ar_capabilities.tsindex df04c6695fd..b7b10836e5e 100644--- a/apps/desktop/src/i18n/ar_capabilities.ts+++ b/apps/desktop/src/i18n/ar_capabilities.ts@@ -1,6 +1,17 @@import type { TranslationOverrides } from './define-locale'export const arCapabilities = {+ skillDeepLink: {+ installTitle: (name: string) => `تثبيت «${name}»؟`,+ installDescription: 'ستتوفر هذه المهارة في الجلسات الجديدة. ثبّت من المصادر التي تثق بها فقط.',+ installTo: 'التثبيت في',+ thisComputer: 'هذا الكمبيوتر',+ installing: 'جارٍ التثبيت…',+ installComplete: (name: string) => `تم تثبيت «${name}»`,+ destinationChanged: 'تغيرت وجهة التثبيت. أغلق هذا الحوار وافتح رابط التثبيت مجددًا.',+ installed: 'المثبتة',+ source: 'المصدر'+ },skills: {plugins: {pageBlurb: 'يمكن للإضافة توسيع هذا التطبيق أو الوكيل أو كليهما — ولكل جزء مفتاح تشغيل مستقل.'@@ -73,4 +84,4 @@ export const arCapabilities = {durationMinutes: (minutes, seconds) => `${minutes} د ${seconds} ث`,tokens: value => `${value} رمز`}-} satisfies Pick<TranslationOverrides, 'skills' | 'agents'>+} satisfies Pick<TranslationOverrides, 'skillDeepLink' | 'skills' | 'agents'>diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex 8df3f423f4c..a3e34fedc05 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -2401,6 +2401,17 @@ export const en: Translations = {}},+ skillDeepLink: {+ installTitle: (name: string) => `Install “${name}”?`,+ installDescription: 'This skill will be available in new sessions. Only install sources you trust.',+ installTo: 'Install to',+ thisComputer: 'This computer',+ installing: 'Installing…',+ installComplete: (name: string) => `“${name}” installed`,+ destinationChanged: 'The destination changed. Close this dialog and open the install link again.',+ installed: 'Installed',+ source: 'Source'+ },skills: {tabSkills: 'Skills',tabToolsets: 'Tools',diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.tsindex 522dfaeb8fc..c1b2b2a8b1e 100644--- a/apps/desktop/src/i18n/ja.ts+++ b/apps/desktop/src/i18n/ja.ts@@ -1623,6 +1623,19 @@ export const ja = defineLocale({}},+ skillDeepLink: {+ installTitle: (name: string) => `「${name}」をインストールしますか?`,+ installDescription:+ 'このスキルは新しいセッションで利用できます。信頼できる提供元からのみインストールしてください。',+ installTo: 'インストール先',+ thisComputer: 'このコンピューター',+ installing: 'インストール中…',+ installComplete: (name: string) => `「${name}」をインストールしました`,+ destinationChanged:+ 'インストール先が変更されました。このダイアログを閉じ、インストールリンクを開き直してください。',+ installed: 'インストール済み',+ source: '提供元'+ },skills: {plugins: {pageBlurb:diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.tsindex c0820946c60..d2537b52e17 100644--- a/apps/desktop/src/i18n/ru.ts+++ b/apps/desktop/src/i18n/ru.ts@@ -1666,6 +1666,17 @@ export const ru = defineLocale({}}},+ skillDeepLink: {+ installTitle: (name: string) => `Установить «${name}»?`,+ installDescription: 'Навык будет доступен в новых сессиях. Устанавливайте только из источников, которым доверяете.',+ installTo: 'Установить в',+ thisComputer: 'Этот компьютер',+ installing: 'Установка…',+ installComplete: (name: string) => `«${name}» установлен`,+ destinationChanged: 'Место установки изменилось. Закройте диалог и снова откройте ссылку установки.',+ installed: 'Установленные',+ source: 'Источник'+ },skills: {plugins: {pageBlurb: 'Плагин может расширять приложение, агента или оба сразу — у каждой части свой переключатель.'diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.tsindex 53f4dd18cbf..5e1bc504763 100644--- a/apps/desktop/src/i18n/types.ts+++ b/apps/desktop/src/i18n/types.ts@@ -2023,6 +2023,17 @@ export interface Translations {}}+ skillDeepLink: {+ installTitle: (name: string) => string+ installDescription: string+ installTo: string+ thisComputer: string+ installing: string+ installComplete: (name: string) => string+ destinationChanged: string+ installed: string+ source: string+ }skills: {tabSkills: stringtabToolsets: stringdiff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.tsindex 8533714ca43..dd773983f0d 100644--- a/apps/desktop/src/i18n/zh-hant.ts+++ b/apps/desktop/src/i18n/zh-hant.ts@@ -13,6 +13,17 @@ import { zhHantDiagnostics } from './zh-hant_diagnostics'import { zhHantSettings } from './zh-hant_settings'export const zhHant = defineLocale({+ skillDeepLink: {+ installTitle: (name: string) => `安裝「${name}」?`,+ installDescription: '此技能將於新的工作階段中可用。請僅安裝可信來源的內容。',+ installTo: '安裝至',+ thisComputer: '這部電腦',+ installing: '正在安裝…',+ installComplete: (name: string) => `已安裝「${name}」`,+ destinationChanged: '安裝目標已變更。請關閉此對話框並重新開啟安裝連結。',+ installed: '已安裝',+ source: '來源'+ },externalOpenFailed: {title: '無法開啟此連結',message: '沒有註冊用於開啟此位址的瀏覽器。請複製連結並手動開啟。',diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex 20e9ce0cf5e..a54b7f56e94 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -2242,6 +2242,17 @@ export const zh = defineLocale({}},+ skillDeepLink: {+ installTitle: (name: string) => `安装“${name}”?`,+ installDescription: '此技能将在新会话中可用。请仅安装可信来源的内容。',+ installTo: '安装到',+ thisComputer: '此电脑',+ installing: '正在安装…',+ installComplete: (name: string) => `已安装“${name}”`,+ destinationChanged: '安装目标已更改。请关闭此对话框并重新打开安装链接。',+ installed: '已安装',+ source: '来源'+ },skills: {tabSkills: '技能',tabToolsets: '工具集',diff --git a/apps/desktop/src/lib/deeplink-routes.test.ts b/apps/desktop/src/lib/deeplink-routes.test.tsindex ace1834ef96..9742789918f 100644--- a/apps/desktop/src/lib/deeplink-routes.test.ts+++ b/apps/desktop/src/lib/deeplink-routes.test.ts@@ -39,6 +39,31 @@ describe('resolveDeepLinkAction', () => {).toEqual({ type: 'plugin-catalog-install', name: '' })})+ it('does not trust URL catalog metadata on a repository install', () => {+ const params = {+ repo: 'https://github.com/owner/repo#plugins/example',+ catalog_name: 'example',+ sha: '0123456789abcdef0123456789abcdef01234567',+ enable: '1'+ }++ const url = new URL(`hermes://plugin/install?${new URLSearchParams(params)}`)++ expect(+ resolveDeepLinkAction({+ kind: url.hostname,+ name: url.pathname.slice(1),+ params: Object.fromEntries(url.searchParams)+ })+ ).toEqual({+ type: 'plugin-install',+ repo: params.repo,+ enable: true,+ force: false,+ legacyHint: null+ })+ })+it('routes legacy plugin-agent alias', () => {expect(resolveDeepLinkAction({@@ -49,6 +74,50 @@ describe('resolveDeepLinkAction', () => {).toMatchObject({ type: 'plugin-install', legacyHint: 'agent' })})+ it('only routes skill installs with an explicit, unchanged identifier', () => {+ const identifier = 'skills-sh/owner/repo/a skill?mode=one&two#readme'+ const url = new URL(`hermes://skill/install?${new URLSearchParams({ identifier })}`)++ expect(+ resolveDeepLinkAction({+ kind: url.hostname,+ name: url.pathname.slice(1),+ params: Object.fromEntries(url.searchParams)+ })+ ).toEqual({ type: 'skill-install', identifier })++ const invalidParams: Record<string, string>[] = [+ {},+ { identifier: '' },+ { identifier: ' ' },+ { identifier: ' official/skill ' }+ ]++ for (const params of invalidParams) {+ expect(resolveDeepLinkAction({ kind: 'skill', name: 'install', params })).toEqual({ type: 'ignore' })+ }++ expect(resolveDeepLinkAction({ kind: 'skill', name: 'remove', params: { identifier } })).toEqual({ type: 'ignore' })+ expect(resolveDeepLinkAction({ kind: 'plugin', name: 'install', params: {} })).toEqual({ type: 'ignore' })+ })++ it('preserves connector completion routing without treating browser status as authority', () => {+ expect(+ resolveDeepLinkAction({+ kind: 'connections',+ name: 'done',+ params: { op: ' operation-1 ', status: ' connected ' }+ })+ ).toEqual({ type: 'connection-done', op: 'operation-1', status: 'connected' })+ expect(+ resolveDeepLinkAction({+ kind: 'connections',+ name: 'done',+ params: { status: 'connected' }+ })+ ).toEqual({ type: 'ignore' })+ })+it('routes blueprint composer inserts', () => {expect(resolveDeepLinkAction({diff --git a/apps/desktop/src/lib/deeplink-routes.ts b/apps/desktop/src/lib/deeplink-routes.tsindex 547728b5657..158254050ea 100644--- a/apps/desktop/src/lib/deeplink-routes.ts+++ b/apps/desktop/src/lib/deeplink-routes.ts@@ -11,6 +11,7 @@ export type DeepLinkAction =/** `hermes://plugin/install?catalog=<name>` — resolved against the curated* catalog by the caller; the raw name is never treated as a git identifier. */| { type: 'plugin-catalog-install'; name: string }+ | { type: 'skill-install'; identifier: string }| { type: 'composer-blueprint'; name: string; params: Record<string, string> }| { type: 'connection-done'; op: string; status: string }| { type: 'ignore' }@@ -50,7 +51,20 @@ export function resolveDeepLinkAction(payload: DeepLinkPayload | null | undefinereturn { type: 'plugin-catalog-install', name: payload.params.catalog.trim() }}- const repo = (payload.params?.repo || payload.params?.identifier || payload.name || '').trim()+ if (payload.kind === 'skill') {+ const identifier = payload.params?.identifier++ return payload.name === 'install' && identifier && identifier === identifier.trim()+ ? { type: 'skill-install', identifier }+ : { type: 'ignore' }+ }++ const repo = (+ payload.params?.repo ||+ payload.params?.identifier ||+ (payload.kind !== 'plugin' ? payload.name : '') ||+ ''+ ).trim()if (payload.kind === 'plugin' && payload.name === 'install' && repo) {return {diff --git a/apps/desktop/src/store/confirm.ts b/apps/desktop/src/store/confirm.tsindex 6fd6fa46d0d..d1918bdaf54 100644--- a/apps/desktop/src/store/confirm.ts+++ b/apps/desktop/src/store/confirm.ts@@ -4,34 +4,68 @@ export interface ConfirmRequest {title: stringdescription?: stringconfirmLabel?: string+ busyLabel?: string+ doneLabel?: string+ details?: { label: string; value: string }[]+ onConfirm?: () => Promise<void>cancelLabel?: stringdestructive?: boolean}export interface PendingConfirm extends ConfirmRequest {+ id: numberresolve: (confirmed: boolean) => void+ phase?: 'running' | 'done'}export const $confirmRequest = atom<null | PendingConfirm>(null)+let nextRequestId = 0// Imperative front door to ConfirmDialog, for handlers that want the answer-// inline the way window.confirm gave it — `if (!ok) return`. A surface that-// wants the busy → done beat or an inline error should mount <ConfirmDialog>-// itself and hand it the async onConfirm.+// inline the way window.confirm gave it — `if (!ok) return`. Pass onConfirm+// to use the shared dialog's progress, completion and inline error states.export function confirm(request: ConfirmRequest): Promise<boolean> {- // One modal at a time: a second ask supersedes the first, which answers no.+ // An action already in progress must not lose its owner or completion UI.+ if ($confirmRequest.get()?.phase) {+ return Promise.resolve(false)+ }++ // One modal at a time: a second ask supersedes an unanswered question.settleConfirm(false)return new Promise<boolean>(resolve => {- $confirmRequest.set({ ...request, resolve })+ $confirmRequest.set({ ...request, id: ++nextRequestId, resolve })})}+/** Run the captured request, not a replacement that arrived during I/O. */+export async function runConfirm(pending: PendingConfirm): Promise<void> {+ if ($confirmRequest.get() !== pending || pending.phase) {+ return+ }++ if (!pending.onConfirm) {+ settleConfirm(true, pending)++ return+ }++ pending.phase = 'running'++ try {+ await pending.onConfirm()+ pending.phase = 'done'+ } catch (error) {+ delete pending.phase+ throw error+ }+}+/** Answer the open request, if there still is one. Idempotent. */-export function settleConfirm(confirmed: boolean): void {+export function settleConfirm(confirmed: boolean, expected?: PendingConfirm): void {const pending = $confirmRequest.get()- if (!pending) {+ if (!pending || pending.phase === 'running' || (expected && pending !== expected)) {return}diff --git a/apps/desktop/src/store/skill-deeplink-install.test.ts b/apps/desktop/src/store/skill-deeplink-install.test.tsnew file mode 100644index 00000000000..99c50ea5a4c--- /dev/null+++ b/apps/desktop/src/store/skill-deeplink-install.test.ts@@ -0,0 +1,105 @@+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'++import { setApiRequestConnection, setApiRequestProfile } from '@/hermes'++import { $confirmRequest, runConfirm, settleConfirm } from './confirm'+import { $connectionsRegistry } from './connection-registry-state'+import type * as HubActions from './hub-actions'+import { installHubSkill } from './hub-actions'+import { notify } from './notifications'+import { requestSkillInstallFromDeepLink } from './skill-deeplink-install'++vi.mock('./hub-actions', async importOriginal => ({+ ...(await importOriginal<typeof HubActions>()),+ installHubSkill: vi.fn()+}))+vi.mock('./notifications', () => ({ notify: vi.fn(), notifyError: vi.fn() }))++beforeEach(() => {+ setApiRequestConnection('local')+ setApiRequestProfile('research')+ vi.mocked(installHubSkill).mockResolvedValue(undefined)+})++afterEach(() => {+ settleConfirm(false)+ $connectionsRegistry.set(null)+ setApiRequestConnection(null)+ setApiRequestProfile(null)+ vi.clearAllMocks()+})++describe('skill link installation', () => {+ it('shows the exact source and readable destination, and cancellation installs nothing', async () => {+ const pending = requestSkillInstallFromDeepLink('clawhub/apple-design')+ expect($confirmRequest.get()).toMatchObject({+ title: 'Install “apple-design”?',+ details: [+ { label: 'Source', value: 'clawhub/apple-design' },+ { label: 'Install to', value: 'This computer · research' }+ ]+ })+ settleConfirm(false)+ await pending+ expect(installHubSkill).not.toHaveBeenCalled()+ expect(notify).not.toHaveBeenCalled()+ })++ it('uses the registered remote name without changing the install destination', async () => {+ setApiRequestConnection('server-a')+ $connectionsRegistry.set({+ version: 2,+ primary: 'server-a',+ secureTokenStorage: false,+ connections: [{ id: 'server-a', kind: 'remote', label: 'Homelab', tokenSet: false, tokenPreview: null }]+ })+ const pending = requestSkillInstallFromDeepLink('official/research/example')+ const request = $confirmRequest.get()!+ expect(request.details?.[1].value).toBe('Homelab · research')+ await runConfirm(request)+ expect(installHubSkill).toHaveBeenCalledExactlyOnceWith('official/research/example', {+ connectionId: 'server-a',+ profile: 'research'+ })+ expect(notify).toHaveBeenCalledWith(expect.objectContaining({ title: '“example” installed' }))+ settleConfirm(true)+ await pending+ })++ it('keeps a failed action retryable without sending a success notification', async () => {+ vi.mocked(installHubSkill).mockRejectedValueOnce(new Error('Download failed'))+ const pending = requestSkillInstallFromDeepLink('clawhub/apple-design')+ const request = $confirmRequest.get()!+ await expect(runConfirm(request)).rejects.toThrow('Download failed')+ expect($confirmRequest.get()).toBe(request)+ expect(request.phase).toBeUndefined()+ expect(notify).not.toHaveBeenCalled()+ await runConfirm(request)+ expect(request.phase).toBe('done')+ expect(notify).toHaveBeenCalledExactlyOnceWith(expect.objectContaining({ title: '“apple-design” installed' }))+ settleConfirm(true)+ await pending+ })++ it('refuses a changed destination before installation or retry', async () => {+ const pending = requestSkillInstallFromDeepLink('clawhub/apple-design')+ setApiRequestConnection('server-b')+ await expect(runConfirm($confirmRequest.get()!)).rejects.toThrow('The destination changed')+ expect(installHubSkill).not.toHaveBeenCalled()+ settleConfirm(false)+ await pending+ })++ it('does not report completion when a profile switch abandons polling', async () => {+ vi.mocked(installHubSkill).mockImplementationOnce(async () => {+ setApiRequestProfile('other')+ })+ const pending = requestSkillInstallFromDeepLink('clawhub/apple-design')+ const request = $confirmRequest.get()!+ await expect(runConfirm(request)).rejects.toThrow('The destination changed')+ expect(request.phase).toBeUndefined()+ expect(notify).not.toHaveBeenCalled()+ settleConfirm(false)+ await pending+ })+})diff --git a/apps/desktop/src/store/skill-deeplink-install.ts b/apps/desktop/src/store/skill-deeplink-install.tsnew file mode 100644index 00000000000..e6740d4c1aa--- /dev/null+++ b/apps/desktop/src/store/skill-deeplink-install.ts@@ -0,0 +1,64 @@+import { getApiRequestConnection, getApiRequestProfile, type ProfileScope } from '@/hermes'+import { translateNow } from '@/i18n'++import { confirm } from './confirm'+import { $connectionsRegistry } from './connection-registry-state'+import { HubInstallBlockedError, installHubSkill, notifyHubActionFailed } from './hub-actions'+import { notify } from './notifications'++/** The URL supplies only an identifier, never a destination profile or scan override. */+export async function requestSkillInstallFromDeepLink(identifier: string): Promise<void> {+ const connectionId = getApiRequestConnection()+ const profile = getApiRequestProfile()+ const scope: ProfileScope = { connectionId, profile }+ const name = identifier.split('/').filter(Boolean).at(-1) || identifier++ const connectionLabel =+ !connectionId || connectionId === 'local'+ ? translateNow('skillDeepLink.thisComputer')+ : $connectionsRegistry.get()?.connections.find(connection => connection.id === connectionId)?.label ||+ connectionId++ const destination = `${connectionLabel} · ${profile || 'default'}`++ const assertDestination = () => {+ if (connectionId !== getApiRequestConnection() || profile !== getApiRequestProfile()) {+ throw new Error(translateNow('skillDeepLink.destinationChanged'))+ }+ }++ await confirm({+ title: translateNow('skillDeepLink.installTitle', name),+ description: translateNow('skillDeepLink.installDescription'),+ details: [+ { label: translateNow('skillDeepLink.source'), value: identifier },+ { label: translateNow('skillDeepLink.installTo'), value: destination }+ ],+ confirmLabel: translateNow('skills.hub.install'),+ busyLabel: translateNow('skillDeepLink.installing'),+ doneLabel: translateNow('skillDeepLink.installed'),+ onConfirm: async () => {+ // Recheck on retries too: a link must never follow a changed destination.+ assertDestination()++ try {+ await installHubSkill(identifier, scope)+ } catch (error) {+ if (error instanceof HubInstallBlockedError) {+ notifyHubActionFailed(error, translateNow('skills.hub.actionFailed'), name, scope)+ }++ throw error+ }++ // The hub abandons polling when the active profile changes. That is not+ // proof of success, so do not show an Installed state in that case.+ assertDestination()+ notify({+ kind: 'success',+ title: translateNow('skillDeepLink.installComplete', name),+ message: translateNow('skills.changesApplyNewSessions')+ })+ }+ })+}diff --git a/apps/shared/src/catalog-install.ts b/apps/shared/src/catalog-install.tsnew file mode 100644index 00000000000..cf36e070e8f--- /dev/null+++ b/apps/shared/src/catalog-install.ts@@ -0,0 +1,31 @@+/** 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+}diff --git a/apps/shared/src/index.ts b/apps/shared/src/index.tsindex 2d9f359534d..00144fdb144 100644--- a/apps/shared/src/index.ts+++ b/apps/shared/src/index.ts@@ -27,6 +27,7 @@ export type {UsageBarData,UsageModelData} from './billing-types'+export { skillCatalogInstallIdentifier, skillCatalogInstallUrl } from './catalog-install'export {driveChargeSettlement,SETTLEMENT_MAX_RETRY_AFTER_MS,diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.jsonindex 79ee81b2ca8..54bab0a8d73 100644--- a/locales/_keys.desktop.json+++ b/locales/_keys.desktop.json@@ -4250,6 +4250,15 @@"sidebar.storageCorrupt.title","sidebar.terminal","sidebar.toolCallCount",+ "skillDeepLink.destinationChanged",+ "skillDeepLink.installComplete",+ "skillDeepLink.installDescription",+ "skillDeepLink.installTitle",+ "skillDeepLink.installTo",+ "skillDeepLink.installed",+ "skillDeepLink.installing",+ "skillDeepLink.source",+ "skillDeepLink.thisComputer","skills.all","skills.appliesToNewSessions","skills.archive",diff --git a/tests/website/test_extract_skills.py b/tests/website/test_extract_skills.pyindex 181a3dbabda..0b946fc1ddf 100644--- a/tests/website/test_extract_skills.py+++ b/tests/website/test_extract_skills.py@@ -17,6 +17,7 @@ per-skill source links and a cleaned-up category sidebar:from __future__ import annotationsimport importlib.util+import jsonfrom pathlib import Pathimport pytest@@ -34,6 +35,42 @@ def mod():return module[email protected]("directory,source,prefix", [+ ("skills", "built-in", "NousResearch/hermes-agent/skills"),+ ("optional-skills", "optional", "official"),+])+def test_local_skills_publish_exact_install_target(mod, tmp_path, monkeypatch, directory, source, prefix):+ skill = tmp_path / directory / "creative" / "nested" / "example"+ skill.mkdir(parents=True)+ (skill / "SKILL.md").write_text("---\nname: Different Display Name\n---\nExample.")+ monkeypatch.setattr(mod, "REPO_ROOT", str(tmp_path))+ [entry] = mod.extract_local_skills()+ expected = f"{prefix}/creative/nested/example"+ assert entry["installIdentifier"] == expected+ assert entry["installCmd"] == f"hermes skills install {expected}"+++def test_unified_skills_keep_source_identifiers_and_match_cli_install_targets(mod, tmp_path, monkeypatch):+ entries = [+ {"source": "clawhub", "identifier": "apple-design", "name": "Display name"},+ {"source": "skills-sh", "identifier": "skills-sh/owner/repo/a skill?mode=one&two#readme"},+ {"source": "github", "identifier": "anthropics/skills/skills/pdf"},+ {"source": "well-known", "identifier": "https://example.com/skills/example"},+ ]+ index = tmp_path / "skills-index.json"+ index.write_text(json.dumps({"skills": entries}))+ monkeypatch.setattr(mod, "UNIFIED_INDEX_PATH", str(index))+ extracted, _ = mod.extract_unified_index_skills()++ assert len(extracted) == len(entries)+ for source, published in zip(entries, extracted):+ identifier = source["identifier"]+ expected = f"clawhub/{identifier}" if source["source"] == "clawhub" else identifier+ assert published["identifier"] == identifier+ assert published["installIdentifier"] == expected+ assert published["installCmd"] == f"hermes skills install {expected}"++# --------------------------------------------------------------------------# _source_url# --------------------------------------------------------------------------diff --git a/website/docs/user-guide/desktop.md b/website/docs/user-guide/desktop.mdindex ce9a0320e81..2767f214820 100644--- a/website/docs/user-guide/desktop.md+++ b/website/docs/user-guide/desktop.md@@ -272,7 +272,7 @@ When you have two or more [profiles](./profiles.md), the config-backed settingsThe app also surfaces the broader Hermes management surface so you don't have to drop to a terminal:-- **Skills** — browse, install, and manage [skills](./features/skills.md). The Skills tab lists your installed skills with enable/disable toggles, and below them the full built-in optional-skills catalog that ships with Hermes — each entry has a one-click **Install** button that flips the row into the installed list once it finishes.+- **Skills** — browse, install, and manage [skills](./features/skills.md). The Skills tab lists your installed skills with enable/disable toggles, and below them the full built-in optional-skills catalog that ships with Hermes — each entry has a one-click **Install** button that flips the row into the installed list once it finishes. The public Skills Hub's **Install in Hermes** buttons open `hermes://skill/install?identifier=...` links that install through the same pipeline after you confirm (see [skill links](./features/skills.md#install-from-the-website)).- **Memory graph (Star Map)** — type `/journey` (aliases `/learning`, `/memory-graph`) in chat to open an interactive constellation of learned skills and memories over time, with a playback scrubber. Nodes can be edited or deleted right from the panel (skills are archived, memories removed). See [Learning Journey](./features/memory.md#learning-journey-journey).- **Cron** — view and manage [scheduled jobs](../reference/cli-commands.md#hermes-cron). With **All profiles** on, the list aggregates every profile's jobs; a job's run history and actions (pause, resume, edit, delete) always go to the profile that owns the job, whichever profile is active.- **Profiles** — switch between [Hermes profiles](./profiles.md) (isolated config/skills/sessions).diff --git a/website/docs/user-guide/features/skills.md b/website/docs/user-guide/features/skills.mdindex b791c38492b..88e468d792b 100644--- a/website/docs/user-guide/features/skills.md+++ b/website/docs/user-guide/features/skills.md@@ -17,6 +17,29 @@ See also:- [Bundled Skills Catalog](../../reference/skills-catalog.md)- [Official Optional Skills Catalog](../../reference/optional-skills-catalog.md)+## Install from the website++Each installable card on the public [Skills Hub](/skills) has an **Install in Hermes**+button. It opens Hermes Desktop with a URL-encoded, source-qualified skill target:+`official/...` for optional skills, `clawhub/...` for ClawHub, and an explicit+repository path for bundled skills rather than an ambiguous bare name. The card's+CLI command uses the same target:++```text+hermes://skill/install?identifier=official%2Fsecurity%2F1password+```++Desktop shows **Install “skill-name”?** with separate **Source** and **Install to**+rows. Cancel makes no changes. After confirmation the dialog shows **Installing…**,+then **Installed** and a completion notification; errors stay in the dialog so you+can retry. Installation goes through the normal Skills Hub pipeline (security scan,+action log, installed-list refresh). If you switch profile or connection while the+confirmation is open, reopen the link for the new destination; a link cannot bypass+scanning or pick a different profile. Changes apply to new sessions.++The `skill/install` route needs an updated Desktop build. If the app is missing or+does not recognize the link, expand the card and copy its CLI install command.+## Starting with a blank slateBy default every profile is seeded with the bundled skill catalog, and each `hermes update` adds any newly bundled skills. If you want a profile with **no bundled skills** — and that stays empty across updates — you have two paths:diff --git a/website/scripts/extract-skills.py b/website/scripts/extract-skills.pyindex 1a0ef30e888..b57276aefa0 100644--- a/website/scripts/extract-skills.py+++ b/website/scripts/extract-skills.py@@ -313,6 +313,11 @@ def extract_local_skills():elif isinstance(cmds, str) and cmds.strip():commands = [cmds.strip()]+ rel_id = rel.replace(os.sep, "/")+ install_identifier = (+ f"official/{rel_id}" if source_label == "optional"+ else f"NousResearch/hermes-agent/skills/{rel_id}"+ )skills.append({"name": fm.get("name", os.path.basename(root)),"description": fm.get("description", ""),@@ -328,6 +333,8 @@ def extract_local_skills():"envVars": env_vars,"commands": commands,"docsPath": _docs_page_path(rel, source_label),+ "installIdentifier": install_identifier,+ "installCmd": f"hermes skills install {install_identifier}",})return skills@@ -438,6 +445,7 @@ def extract_unified_index_skills():"docsPath": "","identifier": identifier,"installCmd": install_cmd,+ "installIdentifier": install_cmd.removeprefix("hermes skills install "),"sourceUrl": source_url,})diff --git a/website/src/pages/skills/index.tsx b/website/src/pages/skills/index.tsxindex 366c25937cb..82b6c0396e6 100644--- a/website/src/pages/skills/index.tsx+++ b/website/src/pages/skills/index.tsx@@ -2,6 +2,7 @@ import React, { useState, useMemo, useCallback, useRef, useEffect } from "react"import Layout from "@theme/Layout";import Link from "@docusaurus/Link";import styles from "./styles.module.css";+import { skillCatalogInstallIdentifier, skillCatalogInstallUrl } from "../../../../apps/shared/src/catalog-install";interface Skill {name: string;@@ -19,6 +20,7 @@ interface Skill {commands?: string[];docsPath?: string;identifier?: string;+ installIdentifier?: string;installCmd?: string;/** Clickable URL to the skill's origin (repo / detail page). Synthesized* in extract-skills.py for community skills that have no generated docs@@ -300,6 +302,7 @@ function SkillCard({}) {const src = SOURCE_CONFIG[skill.source] || SOURCE_CONFIG["optional"];const icon = CATEGORY_ICONS[skill.category] || "\u{1F4E6}";+ const installUrl = skillCatalogInstallUrl(skill);return (<div@@ -351,6 +354,16 @@ function SkillCard({))}</div>+ {!onPick && installUrl && (+ <a+ className={styles.pickBtn}+ href={installUrl}+ onClick={(e) => e.stopPropagation()}+ >+ Install in Hermes+ </a>+ )}+{expanded && (<div className={styles.cardDetail}>{skill.overview && (@@ -419,9 +432,9 @@ function SkillCard({</div>)}<div className={styles.installHint}>- <code>{skill.installCmd || `hermes skills install ${skill.name}`}</code>+ <code>{skill.installCmd || `hermes skills install ${skillCatalogInstallIdentifier(skill) || skill.name}`}</code><CopyButton- text={skill.installCmd || `hermes skills install ${skill.name}`}+ text={skill.installCmd || `hermes skills install ${skillCatalogInstallIdentifier(skill) || skill.name}`}/></div>{onPick ? (@@ -526,8 +539,8 @@ export default function SkillsDashboard() {{type: "hermes-skill-pick",name: skill.name,- identifier: skill.identifier || skill.name,- installCmd: skill.installCmd || `hermes skills install ${skill.name}`,+ identifier: skillCatalogInstallIdentifier(skill) || skill.name,+ installCmd: skill.installCmd || `hermes skills install ${skillCatalogInstallIdentifier(skill) || skill.name}`,source: skill.source,},"*"diff --git a/website/src/pages/skills/styles.module.css b/website/src/pages/skills/styles.module.cssindex 137cc2c489c..a1bba33efd9 100644--- a/website/src/pages/skills/styles.module.css+++ b/website/src/pages/skills/styles.module.css@@ -1204,6 +1204,8 @@color: var(--ifm-color-primary);font-size: 0.85rem;font-weight: 600;+ text-align: center;+ text-decoration: none;cursor: pointer;transition: background 0.15s ease, color 0.15s ease;}@@ -1212,4 +1214,10 @@background: var(--ifm-color-primary);/* --ifm-background-color is transparent in light mode (#91491). */color: var(--ifm-color-emphasis-0, #f7f8fa);+ text-decoration: none;+}++.pickBtn:focus-visible {+ outline: 2px solid var(--ifm-color-primary);+ outline-offset: 2px;}