Skip to content

The agent that grows with you

Revert "feat(desktop): restore native skill and plugin catalogs"

teknium18bd0da2b8c9e
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.tsx
index 0633d6f50f0..dca32b58a00 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,13 +1,9 @@
-import { act, renderHook, waitFor } from '@testing-library/react'
+import { renderHook } from '@testing-library/react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-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 { $pluginInstallRequest } from '@/store/plugin-install-request'
import { _resetLegacyDiscardForTests } from '@/store/session'
import { dropSessionState, publishSessionState } from '@/store/session-states'
import type * as WindowsStore from '@/store/windows'
@@ -589,92 +585,6 @@ 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)
- $pluginInstallRequest.set(null)
- $hubInstalledOverride.set({})
- setApiRequestConnection(null)
- setApiRequestProfile(null)
- })
-
- it('opens the existing plugin confirmation with catalog metadata intact', () => {
- const deepLink = listen()
- const params = { repo: 'owner/repo#plugin', catalog_name: 'catalog-plugin', sha: 'display-pin' }
- deepLink({ kind: 'plugin', name: 'install', params })
-
- expect($pluginInstallRequest.get()).toMatchObject({
- repo: params.repo, catalogName: params.catalog_name, sha: params.sha, enable: true, force: false
- })
- 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) | undefined
diff --git a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts
index a2d72ed60e7..6ad036723ba 100644
--- a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts
+++ b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts
@@ -30,7 +30,6 @@ 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, isSecondaryWindow } from '@/store/windows'
import type { SessionInfo } from '@/types/hermes'
@@ -298,7 +297,6 @@ export function useDesktopIntegrations({
// - mcp/install?… → pending MCP install (explicit confirm, never auto-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)
@@ -337,24 +335,12 @@ export function useDesktopIntegrations({
repo: action.repo,
enable: action.enable,
force: action.force,
- legacyHint: action.legacyHint,
- catalogName: action.catalogName,
- sha: action.sha
+ legacyHint: action.legacyHint
})
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/app/master-detail.tsx b/apps/desktop/src/app/master-detail.tsx
index dddc87e4214..95e117697b9 100644
--- a/apps/desktop/src/app/master-detail.tsx
+++ b/apps/desktop/src/app/master-detail.tsx
@@ -391,12 +391,6 @@ export function ListStripMenu({
)
}
-const LIST_STRIP_LABEL_CLASS = 'text-[0.68rem] font-medium text-muted-foreground/70'
-
-export function ListStripLabel({ children }: { children: ReactNode }) {
- return <span className={LIST_STRIP_LABEL_CLASS} role="status">{children}</span>
-}
-
export function ListStripButton({
active,
children,
@@ -411,8 +405,7 @@ export function ListStripButton({
return (
<button
className={cn(
- LIST_STRIP_LABEL_CLASS,
- 'cursor-pointer transition-colors disabled:opacity-40',
+ 'cursor-pointer text-[0.68rem] font-medium transition-colors disabled:opacity-40',
active ? 'text-foreground' : 'text-muted-foreground/70 hover:text-foreground'
)}
disabled={disabled}
diff --git a/apps/desktop/src/app/settings/plugin-install-modal.test.tsx b/apps/desktop/src/app/settings/plugin-install-modal.test.tsx
index 5116806a8b5..187d0b3574e 100644
--- a/apps/desktop/src/app/settings/plugin-install-modal.test.tsx
+++ b/apps/desktop/src/app/settings/plugin-install-modal.test.tsx
@@ -27,7 +27,7 @@ import {
import { $activeGatewayProfile } from '@/store/profile'
import { $connection, $gatewayState } from '@/store/session'
-import { PluginActions, PluginsTab } from '../skills/plugins-tab'
+import { PluginsTab } from '../skills/plugins-tab'
import { PluginInstallModal } from './plugin-install-modal'
@@ -38,7 +38,6 @@ const renderFlow = () =>
render(
<MemoryRouter initialEntries={['/skills?tab=plugins']}>
<QueryClientProvider client={queryClient}>
- <PluginActions profile={null} />
<PluginsTab profile={null} />
<PluginInstallModal />
</QueryClientProvider>
diff --git a/apps/desktop/src/app/skills/capability-tabs.tsx b/apps/desktop/src/app/skills/capability-tabs.tsx
deleted file mode 100644
index 13e2b808ef2..00000000000
--- a/apps/desktop/src/app/skills/capability-tabs.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { ReactNode } from 'react'
-
-import { TextTab } from '@/components/ui/text-tab'
-import { useI18n } from '@/i18n'
-
-export type CapabilityView = 'installed' | 'browse'
-
-interface CapabilityTabsProps {
- value: CapabilityView
- onChange: (value: CapabilityView) => void
- actions?: ReactNode
-}
-
-/** Shared Installed / Browse navigation for Skills and Plugins. */
-export function CapabilityTabs({ value, onChange, actions }: CapabilityTabsProps) {
- const { t } = useI18n()
-
- return (
- <div className="flex shrink-0 items-center gap-4 px-3 py-1" data-capability-tabs>
- <TextTab active={value === 'installed'} aria-pressed={value === 'installed'} onClick={() => onChange('installed')}>
- {t.catalog.installed}
- </TextTab>
- <TextTab active={value === 'browse'} aria-pressed={value === 'browse'} onClick={() => onChange('browse')}>
- {t.catalog.browse}
- </TextTab>
- {actions && <div className="-my-0.5 -mr-2 ml-auto flex h-6 items-center gap-2">{actions}</div>}
- </div>
- )
-}
diff --git a/apps/desktop/src/app/skills/catalog-browser.tsx b/apps/desktop/src/app/skills/catalog-browser.tsx
deleted file mode 100644
index a1220b70339..00000000000
--- a/apps/desktop/src/app/skills/catalog-browser.tsx
+++ /dev/null
@@ -1,227 +0,0 @@
-import { memo, type ReactNode, useDeferredValue, useEffect, useMemo, useState } from 'react'
-
-import { PageLoader } from '@/components/page-loader'
-import { ActionStatus } from '@/components/ui/action-status'
-import { Badge } from '@/components/ui/badge'
-import { Button } from '@/components/ui/button'
-import { Codicon } from '@/components/ui/codicon'
-import { ErrorState } from '@/components/ui/error-state'
-import { RowButton } from '@/components/ui/row-button'
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
-import { useI18n } from '@/i18n'
-import { ExternalLink } from '@/lib/external-link'
-import { cn } from '@/lib/utils'
-
-import { DetailColumn, ListColumn, ListStrip, ListStripLabel, MasterDetail, ToolChip } from '../master-detail'
-import { PanelEmpty } from '../overlays/panel'
-import { prettyName } from '../settings/helpers'
-
-import type { CapabilityView } from './capability-tabs'
-import { type CatalogEntry, type CatalogKind, useCatalog } from './catalog-data'
-
-interface CatalogBrowserProps {
- kind: CatalogKind
- query?: string
- onQueryChange?: (value: string) => void
- view?: CapabilityView
- isInstalled: (entry: CatalogEntry) => boolean
- onInstall: (entry: CatalogEntry) => void
- isInstalling?: (entry: CatalogEntry) => boolean
- installedEntries?: CatalogEntry[]
- renderInstalledDetail?: (entry: CatalogEntry) => ReactNode
-}
-
-const PAGE_SIZE = 60
-
-export const CatalogBrowser = memo(function CatalogBrowser({
- kind,
- isInstalled,
- onInstall,
- isInstalling,
- installedEntries,
- renderInstalledDetail,
- view = 'browse',
- query = '',
- onQueryChange
-}: CatalogBrowserProps) {
- const { t } = useI18n()
- const c = t.catalog
- const { data, isPending, error, refetch } = useCatalog(kind, view === 'browse')
- const deferredQuery = useDeferredValue(query.trim().toLowerCase())
- const [source, setSource] = useState('all')
- const [category, setCategory] = useState('all')
- const [selectedId, setSelectedId] = useState<string | null>(null)
- const [detailOpen, setDetailOpen] = useState(false)
- const [limit, setLimit] = useState(PAGE_SIZE)
-
- const entries = useMemo(() => {
- return view === 'installed' ? (installedEntries ?? []) : (data ?? [])
- }, [data, installedEntries, view])
- const sources = useMemo(() => [...new Set(entries.map(entry => entry.source))], [entries])
- const categories = useMemo(() => {
- const values = new Map<string, string>()
-
- for (const entry of entries) {
- if (source === 'all' || entry.source === source) {
- values.set(entry.category, entry.categoryLabel)
- }
- }
-
- return [...values].sort((a, b) => a[1].localeCompare(b[1]))
- }, [entries, source])
-
- const filtered = useMemo(() => entries.filter(entry =>
- (source === 'all' || entry.source === source) &&
- (category === 'all' || entry.category === category) &&
- (!deferredQuery || entry.search.includes(deferredQuery))
- ), [entries, source, category, deferredQuery])
- const selected = filtered.find(entry => entry.id === selectedId) ?? filtered[0]
- const installedDetail = selected ? renderInstalledDetail?.(selected) : null
-
- const resetSelection = () => {
- setLimit(PAGE_SIZE)
- setSelectedId(null)
- setDetailOpen(false)
- }
- useEffect(() => {
- setLimit(PAGE_SIZE)
- setSelectedId(null)
- setDetailOpen(false)
- }, [deferredQuery])
-
- const clearFilters = () => {
- onQueryChange?.('')
- setSource('all')
- setCategory('all')
- resetSelection()
- }
-
- const installButton = (entry: CatalogEntry) => {
- const installed = isInstalled(entry)
- const installing = isInstalling?.(entry) ?? false
-
- return (
- <Button disabled={installed || installing || (kind === 'skills' && !entry.installIdentifier)} onClick={() => onInstall(entry)} size="sm" variant={installed ? 'secondary' : 'default'}>
- <ActionStatus
- busy={t.skills.hub.installing}
- done={c.installed}
- idle={t.skills.hub.install}
- idleIcon={<Codicon name="cloud-download" />}
- state={installed ? 'done' : installing ? 'saving' : 'idle'}
- />
- </Button>
- )
- }
-
- const metadata = selected ? [
- [c.author, selected.author],
- [c.source, prettyName(selected.source)],
- [c.category, prettyName(selected.categoryLabel)],
- [c.version, selected.version],
- [c.platforms, selected.platforms.join(', ')],
- [c.requires, selected.requiresHermes ? `Hermes ${selected.requiresHermes}` : ''],
- [c.pinned, selected.sha ? <code title={selected.sha}>{selected.sha.slice(0, 8)}</code> : '']
- ] as [string, ReactNode][] : []
-
- return (
- <div className="flex h-full min-h-0 min-w-0 flex-col" data-catalog={kind}>
- {view === 'browse' && <div className="flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2 px-3 py-2">
- <div className="flex min-w-0 flex-wrap items-center gap-2">
- <div className="w-36">
- <Select onValueChange={value => { setSource(value); setCategory('all'); resetSelection() }} value={source}>
- <SelectTrigger aria-label={c.source}><SelectValue placeholder={c.allSources} /></SelectTrigger>
- <SelectContent>
- <SelectItem value="all">{c.allSources}</SelectItem>
- {sources.map(value => <SelectItem key={value} value={value}>{prettyName(value)}</SelectItem>)}
- </SelectContent>
- </Select>
- </div>
- <div className="w-40">
- <Select onValueChange={value => { setCategory(value); resetSelection() }} value={category}>
- <SelectTrigger aria-label={c.category}><SelectValue placeholder={c.allCategories} /></SelectTrigger>
- <SelectContent>
- <SelectItem value="all">{c.allCategories}</SelectItem>
- {categories.map(([value, label]) => <SelectItem key={value} value={value || 'uncategorized'}>{prettyName(label)}</SelectItem>)}
- </SelectContent>
- </Select>
- </div>
- </div>
- </div>}
- <div className="min-h-0 flex-1">
- {isPending && view === 'browse' && !entries.length ? <PageLoader label={t.skills.loading} /> : error && !entries.length ? (
- <div className="grid h-full place-items-center p-5">
- <ErrorState description={error.message} title={c.loadFailed}>
- <Button onClick={() => void refetch()} size="sm" variant="secondary">{c.retry}</Button>
- </ErrorState>
- </div>
- ) : !selected ? (
- <PanelEmpty action={<Button onClick={clearFilters} size="sm" variant="secondary">{c.clearFilters}</Button>} description={c.tryAnother} icon="search" title={c.noResults} />
- ) : (
- <div className={cn('h-full min-h-0', detailOpen ? '[&_aside]:max-sm:hidden' : '[&_main]:max-sm:hidden')}>
- <MasterDetail resizeId="capabilities-split" split="wide">
- <ListColumn header={<ListStrip left={<ListStripLabel>{c.results(filtered.length)}</ListStripLabel>} />} key={`${source}:${category}:${deferredQuery}`}>
- {filtered.slice(0, limit).map(entry => (
- <RowButton
- aria-pressed={entry.id === selected.id}
- className={cn('row-hover flex w-full min-w-0 items-start gap-3 rounded-md px-2 py-2 text-left', entry.id === selected.id && 'bg-(--ui-row-active-background)')}
- key={entry.id}
- onClick={() => { setSelectedId(entry.id); setDetailOpen(true) }}
- >
- <Codicon className="mt-0.5 shrink-0 text-(--ui-text-tertiary)" name={kind === 'plugins' ? 'extensions' : 'book'} size="1.1rem" />
- <span className="min-w-0 flex-1">
- <span className="flex items-center gap-2">
- <span className="truncate text-[0.78rem] font-medium">{entry.name}</span>
- {isInstalled(entry) && <Codicon className="shrink-0 text-(--ui-text-tertiary)" name="check" />}
- </span>
- <span className="mt-1 line-clamp-2 text-[length:var(--conversation-caption-font-size)] leading-(--conversation-caption-line-height) text-(--ui-text-tertiary)">{entry.description}</span>
- <span className="mt-1.5 flex items-center gap-2 text-[0.65rem] text-(--ui-text-quaternary)">
- <span className="truncate">{entry.author || prettyName(entry.source)}</span>
- {entry.stars !== null && <span className="shrink-0">☆ {entry.stars.toLocaleString()}</span>}
- </span>
- </span>
- </RowButton>
- ))}
- {filtered.length > limit && <Button onClick={() => setLimit(value => value + PAGE_SIZE)} size="sm" variant="text">{c.more}</Button>}
- </ListColumn>
- <DetailColumn footer={c.snapshotHint}>
- <div className="sm:hidden"><Button onClick={() => setDetailOpen(false)} size="sm" variant="text"><Codicon name="arrow-left" />{c.back}</Button></div>
- {installedDetail || <>
- <header className="space-y-3">
- <div className="flex items-start gap-3">
- <Codicon className="mt-1 shrink-0 text-(--ui-text-tertiary)" name={kind === 'plugins' ? 'extensions' : 'book'} size="1.5rem" />
- <div className="min-w-0">
- <h3 className="break-words text-lg font-semibold tracking-tight">{selected.name}</h3>
- <p className="mt-1 text-xs text-(--ui-text-tertiary)">{selected.author || prettyName(selected.source)}</p>
- </div>
- </div>
- <div className="flex flex-wrap items-center gap-2">
- {installButton(selected)}
- <Badge variant="muted">{prettyName(selected.source)}</Badge>
- {selected.stars !== null && <span className="text-xs text-(--ui-text-tertiary)">☆ {selected.stars.toLocaleString()}</span>}
- </div>
- </header>
- <section className="space-y-2">
- <h4 className="text-xs font-medium">{c.about}</h4>
- <p className="whitespace-pre-wrap break-words text-[length:var(--conversation-caption-font-size)] leading-relaxed text-(--ui-text-secondary)">{selected.description}</p>
- {selected.overview && selected.overview !== selected.description && <p className="whitespace-pre-wrap break-words text-[length:var(--conversation-caption-font-size)] leading-relaxed text-(--ui-text-tertiary)">{selected.overview}</p>}
- </section>
- <dl className="space-y-2 text-[length:var(--conversation-caption-font-size)]">
- {metadata.filter(([, value]) => Boolean(value)).map(([label, value]) => <div className="grid grid-cols-[6rem_minmax(0,1fr)] gap-3" key={label}><dt className="text-(--ui-text-tertiary)">{label}</dt><dd className="m-0 break-words">{value}</dd></div>)}
- </dl>
- {[[c.tools, selected.tools], [c.hooks, selected.hooks], [c.requires, selected.requirements]].map(([label, values]) => (values as string[]).length > 0 && (
- <section className="space-y-2" key={label as string}><h4 className="text-xs font-medium">{label as string}</h4><div className="flex flex-wrap gap-1">{(values as string[]).map(value => <ToolChip key={value}>{value}</ToolChip>)}</div></section>
- ))}
- <div className="flex flex-wrap gap-3 text-xs">
- {selected.sourceUrl && <ExternalLink href={selected.sourceUrl}>{c.repository}</ExternalLink>}
- {selected.docsUrl && <ExternalLink href={selected.docsUrl}>{c.documentation}</ExternalLink>}
- </div>
- <p className="text-[0.65rem] leading-relaxed text-(--ui-text-quaternary)">{c.installHint}</p>
- </>}
- </DetailColumn>
- </MasterDetail>
- </div>
- )}
- </div>
- </div>
- )
-})
diff --git a/apps/desktop/src/app/skills/catalog-data.test.ts b/apps/desktop/src/app/skills/catalog-data.test.ts
deleted file mode 100644
index 4062999cf48..00000000000
--- a/apps/desktop/src/app/skills/catalog-data.test.ts
+++ /dev/null
@@ -1,136 +0,0 @@
-import { afterEach, describe, expect, it, vi } from 'vitest'
-
-import { fetchCatalog, parseCatalog } from './catalog-data'
-
-afterEach(() => vi.unstubAllGlobals())
-
-describe('public catalog data', () => {
- it('preserves every source and distinct install identifier, including same-named skills', () => {
- const rows = ['official', 'github', 'community', 'future-source'].map(source => ({
- name: 'research',
- identifier: `${source}/research`,
- source,
- author: `${source} maintainer`,
- description: `Research from ${source}`,
- category: 'research',
- categoryLabel: 'Research',
- tags: [`${source}-tag`],
- envVars: [`${source.toUpperCase()}_KEY`]
- }))
- // Same source, different identifier is also a distinct install target.
- rows.push({ ...rows[0], identifier: 'official/alternate/research' })
-
- const entries = parseCatalog('skills', rows)
-
- expect(entries).toHaveLength(rows.length)
- expect(new Set(entries.map(entry => entry.id)).size).toBe(rows.length)
- rows.forEach(row => {
- const entry = entries.find(candidate => candidate.identifier === row.identifier)
- expect(entry).toMatchObject({
- name: row.name,
- identifier: row.identifier,
- source: row.source,
- author: row.author,
- description: row.description,
- categoryLabel: row.categoryLabel,
- tags: row.tags,
- requirements: row.envVars
- })
- expect(entry?.search).toContain(row.source)
- expect(entry?.search).toContain(row.tags[0])
- })
- })
-
- it('keeps catalog identity separate from the source-qualified skill install target', () => {
- const [entry] = parseCatalog('skills', [{
- name: 'Apple Design', identifier: 'apple-design', source: 'ClawHub',
- installCmd: 'hermes skills install clawhub/apple-design'
- }])
-
- expect(entry.identifier).toBe('apple-design')
- expect(entry.installIdentifier).toBe('clawhub/apple-design')
- })
-
- it('keeps each plugin tier, pinned install target, and published detail metadata together', () => {
- const rows = ['official', 'community', 'future-tier'].map(tier => ({
- name: `${tier}-plugin`,
- tier,
- repo: `https://github.com/example/${tier}-plugins`,
- subdir: 'packages/weather',
- sha: 'a'.repeat(40),
- maintainer: `${tier} maintainer`,
- overview: `Overview for ${tier}`,
- version: '1.2.3',
- requiresHermes: '>=0.17',
- platforms: ['macos', 'linux'],
- docsUrl: `https://example.com/${tier}/docs`,
- capabilities: {
- providesTools: [`${tier}_forecast`],
- providesHooks: ['on_session_start'],
- requiresEnv: ['WEATHER_KEY']
- }
- }))
-
- const entries = parseCatalog('plugins', rows)
-
- expect(entries).toHaveLength(rows.length)
- rows.forEach(row => {
- const entry = entries.find(candidate => candidate.name === row.name)
- expect(entry).toMatchObject({
- name: row.name,
- source: row.tier,
- repo: row.repo,
- sha: row.sha,
- subdir: row.subdir,
- author: row.maintainer,
- overview: row.overview,
- version: row.version,
- requiresHermes: row.requiresHermes,
- platforms: row.platforms,
- docsUrl: row.docsUrl,
- sourceUrl: row.repo,
- tools: row.capabilities.providesTools,
- hooks: row.capabilities.providesHooks,
- requirements: row.capabilities.requiresEnv
- })
- expect(entry?.search).toContain(row.capabilities.providesTools[0])
- })
- })
-
- it.each(['skills', 'plugins'] as const)('fetches only the published %s snapshot and parses it', async kind => {
- const rows = [{
- name: 'weather',
- identifier: 'official/weather',
- source: 'official',
- tier: 'official',
- repo: 'https://github.com/example/weather',
- sourceUrl: 'https://github.com/example/weather/blob/main/SKILL.md'
- }]
- const fetch = vi.fn().mockResolvedValue({ ok: true, json: async () => rows })
- vi.stubGlobal('fetch', fetch)
-
- expect(await fetchCatalog(kind)).toEqual(parseCatalog(kind, rows))
- expect(fetch).toHaveBeenCalledExactlyOnceWith(
- `https://nousresearch.github.io/hermes-agent/docs/api/${kind}.json`,
- expect.objectContaining({ credentials: 'omit', signal: expect.any(AbortSignal) })
- )
- })
-
- it('only renders plugin images hosted on GitHub so the browser never fans out to third-party hosts', () => {
- const base = { name: 'x', tier: 'community', repo: 'https://github.com/o/r', sha: 'a'.repeat(40), version: '1.4.0' }
- const [github, offhost, http] = parseCatalog('plugins', [
- { ...base, name: 'github', image: 'https://raw.githubusercontent.com/o/r/abc/banner.png' },
- { ...base, name: 'offhost', image: 'https://cdn.example.com/banner.png' },
- { ...base, name: 'http', image: 'http://github.com/o/r/banner.png' }
- ])
-
- expect(github.imageUrl).toBe('https://raw.githubusercontent.com/o/r/abc/banner.png')
- expect(github.version).toBe('1.4.0')
- expect(offhost.imageUrl).toBeNull()
- expect(http.imageUrl).toBeNull()
- })
-
- it('rejects a non-catalog response instead of treating an error payload as an empty catalog', () => {
- expect(() => parseCatalog('skills', { error: 'Service unavailable' })).toThrow('Invalid catalog response')
- })
-})
diff --git a/apps/desktop/src/app/skills/catalog-data.ts b/apps/desktop/src/app/skills/catalog-data.ts
deleted file mode 100644
index e8774431e35..00000000000
--- a/apps/desktop/src/app/skills/catalog-data.ts
+++ /dev/null
@@ -1,157 +0,0 @@
-import { skillCatalogInstallIdentifier } from '@hermes/shared'
-import { useQuery } from '@tanstack/react-query'
-
-export type CatalogKind = 'skills' | 'plugins'
-
-export interface CatalogEntry {
- id: string
- name: string
- description: string
- overview: string
- category: string
- categoryLabel: string
- source: string
- author: string
- identifier: string
- installIdentifier?: string | null
- repo: string
- sha: string
- subdir: string
- version: string
- requiresHermes: string
- tags: string[]
- platforms: string[]
- requirements: string[]
- tools: string[]
- hooks: string[]
- sourceUrl: string | null
- docsUrl: string | null
- /** GitHub-hosted banner for plugin entries; the only third-party fetch the browser makes. */
- imageUrl: string | null
- stars: number | null
- search: string
-}
-
-const DOCS_ORIGIN = 'https://hermes-agent.nousresearch.com'
-// The public domain redirects here without CORS headers on the redirect.
-// Use the docs' actual static host, not GitHub's API or repository endpoints.
-const CATALOG_BASE = 'https://nousresearch.github.io/hermes-agent/docs/api'
-const text = (value: unknown): string => typeof value === 'string' ? value : ''
-const strings = (value: unknown): string[] => Array.isArray(value) ? value.filter(v => typeof v === 'string') : []
-
-const IMAGE_HOSTS = new Set(['raw.githubusercontent.com', 'github.com'])
-
-/** Mirrors scripts/validate_plugin_catalog.py: https on a GitHub host, else no image. */
-export function catalogImageUrl(value: unknown): string | null {
- try {
- const url = new URL(text(value))
- const host = url.hostname.toLowerCase()
-
- return url.protocol === 'https:' && (IMAGE_HOSTS.has(host) || host.endsWith('.githubusercontent.com')) ? url.href : null
- } catch {
- return null
- }
-}
-
-function webUrl(value: unknown): string | null {
- try {
- const url = new URL(text(value))
-
- return url.protocol === 'https:' || url.protocol === 'http:' ? url.href : null
- } catch {
- return null
- }
-}
-
-export function parseCatalog(kind: CatalogKind, data: unknown): CatalogEntry[] {
- if (!Array.isArray(data)) {
- throw new Error('Invalid catalog response')
- }
-
- const entries = new Map<string, CatalogEntry>()
-
- for (const row of data) {
- if (!row || typeof row !== 'object' || !text(row.name)) {
- continue
- }
-
- const name = text(row.name)
- const source = text(kind === 'plugins' ? row.tier : row.source)
- const identifier = text(row.identifier) || name
- const id = `${source}:${identifier}`
- const caps = row.capabilities ?? {}
- const category = text(row.category) || 'uncategorized'
- const tags = strings(row.tags)
- const tools = strings(caps.providesTools)
- const hooks = strings(caps.providesHooks)
- const author = text(row.maintainer ?? row.author)
- const description = text(row.description)
-
- entries.set(id, {
- id,
- name,
- description,
- overview: text(row.overview),
- category,
- categoryLabel: text(row.categoryLabel) || category,
- source,
- author,
- identifier,
- installIdentifier: kind === 'skills' ? skillCatalogInstallIdentifier({
- name, source, identifier: text(row.identifier), installIdentifier: text(row.installIdentifier)
- }) : null,
- repo: text(row.repo),
- sha: text(row.sha),
- subdir: text(row.subdir),
- version: text(row.version),
- requiresHermes: text(row.requiresHermes),
- tags,
- tools,
- hooks,
- platforms: strings(row.platforms),
- requirements: strings(kind === 'plugins' ? caps.requiresEnv : row.envVars),
- sourceUrl: webUrl(row.repo || row.sourceUrl),
- docsUrl: webUrl(row.docsUrl) || (text(row.docsPath)
- ? `${DOCS_ORIGIN}/docs/user-guide/skills/${text(row.docsPath)}`
- : null),
- imageUrl: kind === 'plugins' ? catalogImageUrl(row.image) : null,
- stars: typeof row.stars === 'number' && Number.isFinite(row.stars) ? row.stars : null,
- search: [name, description, author, category, row.categoryLabel, source, ...tags, ...tools, ...hooks]
- .filter(Boolean).join(' ').toLowerCase()
- })
- }
-
- return [...entries.values()]
-}
-
-export async function fetchCatalog(kind: CatalogKind): Promise<CatalogEntry[]> {
- // These are the same published snapshots as the docs galleries. Never fan
- // out to repositories, README previews, avatars, or live hub searches.
- const response = await fetch(`${CATALOG_BASE}/${kind}.json`, {
- credentials: 'omit',
- signal: AbortSignal.timeout(60_000)
- })
-
- if (!response.ok) {
- throw new Error(`Catalog HTTP ${response.status}`)
- }
-
- return parseCatalog(kind, await response.json())
-}
-
-export function useCatalog(kind: CatalogKind, enabled = true) {
- return useQuery({
- queryKey: ['public-catalog', kind],
- // Re-enabling a mounted query retries errors even with retryOnMount off.
- // Keep failures parked until the user explicitly chooses Try again.
- enabled: query => enabled && query.state.status !== 'error',
- queryFn: () => fetchCatalog(kind),
- staleTime: 30 * 60_000,
- gcTime: Infinity,
- refetchOnWindowFocus: false,
- refetchOnReconnect: false,
- refetchOnMount: false,
- retryOnMount: false,
- retry: false
- })
-}
diff --git a/apps/desktop/src/app/skills/embedded-hub-picker.tsx b/apps/desktop/src/app/skills/embedded-hub-picker.tsx
new file mode 100644
index 00000000000..9139cecbe99
--- /dev/null
+++ b/apps/desktop/src/app/skills/embedded-hub-picker.tsx
@@ -0,0 +1,249 @@
+import { useStore } from '@nanostores/react'
+import { memo, type PointerEvent as ReactPointerEvent, useEffect, useRef, useState } from 'react'
+
+import { Button } from '@/components/ui/button'
+import type { ProfileScope } from '@/hermes'
+import { useI18n } from '@/i18n'
+import { Loader2 } from '@/lib/icons'
+import { useStoreSelector } from '@/lib/use-session-slice'
+import { cn } from '@/lib/utils'
+import { $hubActions, installHubSkill, notifyHubActionFailed, UPDATE_ALL_KEY, updateHubSkills } from '@/store/hub-actions'
+import { notify, notifyError } from '@/store/notifications'
+import { $paneHeightOverride, setPaneHeightOverride } from '@/store/panes'
+
+// The REAL Skills Hub page (docs site) embedded as a one-click picker — the
+// same trick the Bot Mode agent editor uses. `?embed=picker` hides the docs
+// chrome and adds a "+ Add to this Agent" button per card, which posts
+// { type: 'hermes-skill-pick', name, identifier, installCmd, source }
+// to the parent window. We validate the origin and route the install through
+// the standard hub action pipeline (background action + tailed log + Skills
+// list invalidation), scoped to the Capabilities profile selector.
+const HUB_ORIGIN = 'https://hermes-agent.nousresearch.com'
+const HUB_PICKER_URL = `${HUB_ORIGIN}/docs/skills?embed=picker`
+
+// Hub viewport height: persisted through the shared pane store (same one the
+// terminal/editor panes use), dragged from the section's TOP edge — "pull the
+// hub up" — clamped so neither the hub nor the skills list above vanishes.
+const HUB_PANE_ID = 'capabilities-hub'
+const HUB_DEFAULT_PX = 380
+const HUB_MIN_PX = 120
+const HUB_MAX_VH = 0.75
+// Collapse threshold, mirroring DetailPane: a persisted height at/below this
+// reads as "collapsed to the header" (the toggle stores 0).
+const HUB_COLLAPSED_PX = 4
+// Room the sash must always leave for the content ABOVE the picker (the
+// installed-skills list plus its strip) so dragging the hub up can never
+// crush the list to zero and shove its chrome under the hub header.
+const HUB_LIST_RESERVED_PX = 176
+
+interface SkillPickMessage {
+ identifier?: string
+ installCmd?: string
+ name?: string
+ source?: string
+ type?: string
+}
+
+interface EmbeddedHubPickerProps {
+ /** Kept mounted but fully hidden (display:none). The Capabilities view uses
+ * this to preserve the loaded hub iframe across tab switches — a plain
+ * unmount would reload the whole docs site on every return to Skills. */
+ hidden?: boolean
+ /** Names of skills already installed in the scoped profile — a pick that
+ * matches is refused with a toast instead of re-running the install. */
+ installedNames: ReadonlySet<string>
+ /** Capabilities profile-scope override — installs land in THIS profile;
+ * undefined/null targets the app-wide active profile. */
+ profile?: ProfileScope
+}
+
+/** The Skills Hub browser for the Skills tab: a resizable iframe of the live
+ * hub where every card installs with one click. Expanded by default —
+ * discovery IS the point — with a collapse toggle (persisted, like every
+ * other pane) and an update-all action. Memoized: the iframe must not sit in
+ * the parent's keystroke/re-render path. */
+export const EmbeddedHubPicker = memo(function EmbeddedHubPicker({
+ hidden = false,
+ installedNames,
+ profile
+}: EmbeddedHubPickerProps) {
+ const { t } = useI18n()
+ const h = t.skills.hub
+ // Subscribe to the ONE flag this header renders, not the whole action map —
+ // $hubActions churns on every tailed log line during an install.
+ const updating = useStoreSelector($hubActions, actions => actions[UPDATE_ALL_KEY]?.running ?? false)
+ // Collapse state rides the same persisted height override the sash writes
+ // (0 = collapsed to the header), so "Hide the hub browser" survives tab
+ // switches and restarts instead of re-expanding — and re-loading the docs
+ // site — on every visit. Same contract as DetailPane.
+ const heightOverride = useStore($paneHeightOverride(HUB_PANE_ID))
+ const height = heightOverride ?? HUB_DEFAULT_PX
+ const open = height > HUB_COLLAPSED_PX
+ const [dragging, setDragging] = useState(false)
+ const sectionRef = useRef<HTMLElement>(null)
+
+ // Top-edge sash: dragging UP grows the hub (shrinking the skills list above,
+ // which is the flex-1 sibling). Same gesture as DetailPane / the shell's
+ // bottom panes; double-click resets to the default height. The iframe gets
+ // pointer-events disabled for the duration or it swallows the pointermoves.
+ const startDrag = (event: ReactPointerEvent<HTMLDivElement>) => {
+ if (event.button !== 0) {
+ return
+ }
+
+ event.preventDefault()
+ const startY = event.clientY
+ const startHeight = height
+ // Clamp against the actual Capabilities column, not just the window: the
+ // hub may never grow past "column minus the list's reserved strip", so
+ // the installed list always keeps real height and its header/footer can't
+ // end up sharing pixels with the hub header.
+ const column = sectionRef.current?.parentElement
+ const columnMax = column ? column.clientHeight - HUB_LIST_RESERVED_PX : Number.POSITIVE_INFINITY
+ const max = Math.max(HUB_MIN_PX, Math.round(Math.min(window.innerHeight * HUB_MAX_VH, columnMax)))
+ setDragging(true)
+
+ const onMove = (move: globalThis.PointerEvent) => {
+ setPaneHeightOverride(
+ HUB_PANE_ID,
+ Math.round(Math.min(max, Math.max(HUB_MIN_PX, startHeight + (startY - move.clientY))))
+ )
+ }
+
+ const onUp = () => {
+ window.removeEventListener('pointermove', onMove)
+ setDragging(false)
+ }
+
+ window.addEventListener('pointermove', onMove)
+ window.addEventListener('pointerup', onUp, { once: true })
+ }
+
+ // Picker messages from the embedded hub page. Origin-checked; installs route
+ // through the same store pipeline the hub rows use, so the action log,
+ // optimistic flips, and Skills-list refresh all come for free.
+ useEffect(() => {
+ if (!open) {
+ return undefined
+ }
+
+ const onMessage = (event: MessageEvent) => {
+ if (event.origin !== HUB_ORIGIN) {
+ return
+ }
+
+ const data = event.data as SkillPickMessage | null
+
+ if (!data || data.type !== 'hermes-skill-pick' || !data.name) {
+ return
+ }
+
+ const target = String(data.identifier || data.name)
+ const label = String(data.name)
+
+ // Already installed in this scope → tell the user, don't reinstall.
+ if (installedNames.has(label) || installedNames.has(target)) {
+ notify({ kind: 'success', title: h.alreadyInstalled(label), message: '' })
+
+ return
+ }
+
+ notify({ kind: 'success', title: h.installStarted(label), message: h.actionLog })
+ void installHubSkill(target, profile).catch(err => notifyHubActionFailed(err, h.actionFailed, label, profile))
+ }
+
+ window.addEventListener('message', onMessage)
+
+ return () => window.removeEventListener('message', onMessage)
+ }, [h, installedNames, open, profile])
+
+ const updateAll = () => {
+ notify({ kind: 'success', title: h.updateStarted, message: h.actionLog })
+ void updateHubSkills(profile).catch(err => notifyError(err, h.actionFailed))
+ }
+
+ return (
+ <section
+ className={cn(
+ // Shrinkable (no shrink-0) + overflow-hidden: the picker is a flex
+ // child of the Capabilities column. Before, its fixed-height viewport
+ // made the section's min-content height rigid, so a short window (or a
+ // tall persisted drag height) starved the installed list to 0px and
+ // the list's strip/footer painted straight over this header. Now the
+ // section clips its own content and gives height back to the list;
+ // min-h keeps the header row itself always visible.
+ 'relative flex min-h-9 flex-col overflow-hidden border-t border-(--ui-stroke-secondary)',
+ hidden && 'hidden'
+ )}
+ ref={sectionRef}
+ >
+ {/* Top-edge drag sash — pull the whole hub section up/down. */}
+ <div
+ className="group/hubsash absolute inset-x-0 top-0 z-10 h-1 -translate-y-1/2 cursor-row-resize"
+ onDoubleClick={() => setPaneHeightOverride(HUB_PANE_ID, undefined)}
+ onPointerDown={startDrag}
+ >
+ <div
+ className={cn(
+ 'absolute inset-x-0 top-1/2 h-px -translate-y-1/2 transition-colors',
+ dragging ? 'bg-(--ui-stroke-secondary)' : 'group-hover/hubsash:bg-(--ui-stroke-secondary)'
+ )}
+ />
+ </div>
+ <div className="flex shrink-0 items-center justify-between px-3 py-1.5">
+ <span className="text-[0.7rem] font-medium text-(--ui-text-tertiary)">{h.pickerTitle}</span>
+ <div className="flex items-center gap-1">
+ <Button disabled={updating} onClick={updateAll} size="xs" variant="text">
+ {updating && <Loader2 className="size-3 animate-spin" />}
+ {updating ? h.updating : h.updateAll}
+ </Button>
+ <Button onClick={() => setPaneHeightOverride(HUB_PANE_ID, open ? 0 : undefined)} size="xs" variant="text">
+ {open ? h.pickerHide : h.pickerBrowse}
+ </Button>
+ </div>
+ </div>
+ {open && (
+ <div className="flex min-h-0 flex-col gap-1 px-3 pb-2">
+ {/* Resizable viewport: height comes from the top-edge drag sash
+ above (persisted; double-click resets). flex-basis instead of a
+ hard height so a short window shrinks the hub viewport rather
+ than letting it spill over the list. The iframe is rendered
+ oversized and scaled DOWN (133% × 0.75) so the hub page starts
+ zoomed out — the cross-origin page itself can't be styled, but
+ scaling the frame is ours. */}
+ <div
+ style={{
+ border: '1px solid var(--ui-stroke-secondary)',
+ borderRadius: 8,
+ flex: `0 1 ${height}px`,
+ maxWidth: '100%',
+ minHeight: 0,
+ minWidth: 320,
+ overflow: 'hidden',
+ position: 'relative',
+ width: '100%'
+ }}
+ >
+ <iframe
+ sandbox="allow-scripts allow-same-origin"
+ src={HUB_PICKER_URL}
+ style={{
+ background: 'transparent',
+ border: 'none',
+ height: '133.34%',
+ // While the sash drags, the cross-origin iframe must not eat
+ // the pointermove stream.
+ pointerEvents: dragging ? 'none' : 'auto',
+ transform: 'scale(0.75)',
+ transformOrigin: 'top left',
+ width: '133.34%'
+ }}
+ title={h.pickerTitle}
+ />
+ </div>
+ <p className="shrink-0 px-1 text-[0.65rem] leading-4 text-(--ui-text-quaternary)">{h.pickerHint}</p>
+ </div>
+ )}
+ </section>
+ )
+})
diff --git a/apps/desktop/src/app/skills/index.test.tsx b/apps/desktop/src/app/skills/index.test.tsx
index e1e9b609232..daaa3224a01 100644
--- a/apps/desktop/src/app/skills/index.test.tsx
+++ b/apps/desktop/src/app/skills/index.test.tsx
@@ -1,6 +1,6 @@
// @vitest-environment jsdom
import { QueryClientProvider } from '@tanstack/react-query'
-import { act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
+import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
import { MemoryRouter } from 'react-router'
import type * as ReactRouterDom from 'react-router'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
@@ -9,9 +9,6 @@ import type * as HermesApi from '@/hermes'
import { queryClient } from '@/lib/query-client'
import type * as HubActions from '@/store/hub-actions'
-import { parseCatalog } from './catalog-data'
-import { SkillCatalog } from './skill-catalog'
-
const getSkills = vi.fn()
const getToolsets = vi.fn()
const setSkillEnabled = vi.fn()
@@ -21,6 +18,7 @@ const selectToolsetProvider = vi.fn()
const getUsageAnalytics = vi.fn()
const getProfiles = vi.fn()
const getSkillContent = vi.fn()
+const getOfficialSkills = vi.fn()
// Partial mock: keep the real module (SkillsView pulls in @/store/profile,
// whose import-time subscription calls setApiRequestProfile) and stub only the
@@ -37,7 +35,8 @@ vi.mock('@/hermes', async importOriginal => ({
selectToolsetProvider: (toolset: string, provider: string) => selectToolsetProvider(toolset, provider),
getUsageAnalytics: (days: number, profile?: null | string) => getUsageAnalytics(days, profile),
getProfiles: () => getProfiles(),
- getSkillContent: (name: string, profile?: null | string) => getSkillContent(name, profile)
+ getSkillContent: (name: string, profile?: null | string) => getSkillContent(name, profile),
+ getOfficialSkills: (profile?: null | string) => getOfficialSkills(profile)
}))
// Notifications hit nanostores/timers we don't care about here.
@@ -103,6 +102,7 @@ beforeEach(() => {
setToolsetEnabled.mockResolvedValue({ ok: true, name: 'web', enabled: false })
getToolsetConfig.mockResolvedValue({ has_category: true, active_provider: null, providers: [] })
getUsageAnalytics.mockResolvedValue({ tools: [] })
+ getOfficialSkills.mockResolvedValue({ skills: [] })
getSkillContent.mockResolvedValue({
name: 'web-research',
path: '/skills/web-research/SKILL.md',
@@ -116,7 +116,6 @@ beforeEach(() => {
afterEach(() => {
cleanup()
vi.clearAllMocks()
- vi.unstubAllGlobals()
// Shared singleton client — drop cached skills/toolsets so each test refetches.
queryClient.clear()
})
@@ -285,163 +284,42 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
expect(await screen.findByText(/Deep research steps/)).toBeTruthy()
})
- it.each(['web-research', 'official/research/web-research'])(
- 'disables catalog installation when the installed list contains %s',
- async installedName => {
- const { installHubSkill } = await import('@/store/hub-actions')
- queryClient.setQueryData(['public-catalog', 'skills'], parseCatalog('skills', [{
- name: 'web-research',
- identifier: 'official/research/web-research',
- source: 'official',
- category: 'research',
- description: 'Research the web'
- }]))
+ it('hub picker refuses to reinstall an already-installed skill', async () => {
+ const { notify } = await import('@/store/notifications')
+ const { EmbeddedHubPicker } = await import('./embedded-hub-picker')
- render(
- <QueryClientProvider client={queryClient}>
- <SkillCatalog installedNames={new Set([installedName])} profile="researcher" />
- </QueryClientProvider>
- )
+ render(<EmbeddedHubPicker installedNames={new Set(['web-research'])} profile={null} />)
- fireEvent.click(screen.getByRole('button', { name: /^web-research/ }))
- const installed = screen.getByRole('button', { name: 'Installed' })
- expect((installed as HTMLButtonElement).disabled).toBe(true)
- fireEvent.click(installed)
- expect(installHubSkill).not.toHaveBeenCalled()
- }
- )
-
- it.each([
- {
- source: 'github',
- identifier: 'github:example/skills/research/community-research',
- expectedIdentifier: 'github:example/skills/research/community-research'
- },
- {
- source: 'clawhub',
- identifier: 'community-research',
- expectedIdentifier: 'clawhub/community-research'
- },
- {
- source: 'clawhub',
- identifier: 'clawhub/community-research',
- expectedIdentifier: 'clawhub/community-research'
- }
- ])('installs $identifier with its source-qualified target in the pinned connection and profile', async ({ source, identifier, expectedIdentifier }) => {
- const { installHubSkill } = await import('@/store/hub-actions')
- const entry = {
- name: 'community-research',
- identifier,
- source,
- category: 'research',
- description: 'Community research workflow'
- }
- queryClient.setQueryData(['public-catalog', 'skills'], parseCatalog('skills', [
- { ...entry, name: 'other-skill', source: 'github', identifier: 'github:example/skills/other-skill' },
- entry
- ]))
+ // The picker is expanded by default — the hub iframe is live on mount.
+ expect(document.querySelector('iframe')).toBeTruthy()
await act(async () => {
- render(
- <QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/skills']}>
- <SkillsView embedded fixedConnection="homelab" fixedProfile="researcher" />
- </MemoryRouter>
- </QueryClientProvider>
+ window.dispatchEvent(
+ new MessageEvent('message', {
+ data: { type: 'hermes-skill-pick', name: 'web-research', identifier: 'web-research' },
+ origin: 'https://hermes-agent.nousresearch.com'
+ })
)
})
- fireEvent.click(screen.getByRole('button', { name: 'Browse' }))
- fireEvent.click(await screen.findByRole('button', { name: /^community-research/ }))
- expect(screen.getByRole('heading', { name: entry.name })).toBeTruthy()
- await act(async () => {
- fireEvent.click(screen.getByRole('button', { name: 'Install' }))
- })
-
- expect(installHubSkill).toHaveBeenCalledExactlyOnceWith(expectedIdentifier, {
- connectionId: 'homelab', profile: 'researcher'
- })
- })
-
- it('keeps a pending install tied to its entry and scope when the pinned target changes', async () => {
- const { installHubSkill } = await import('@/store/hub-actions')
- const identifier = 'clawhub/community-research'
- queryClient.setQueryData(['public-catalog', 'skills'], parseCatalog('skills', [
- { name: 'community-research', identifier: 'community-research', source: 'clawhub' },
- { name: 'other-skill', identifier: 'official/research/other-skill', source: 'optional' }
- ]))
- let finishFirst!: () => void
- let finishSecond!: () => void
- const firstInstall = new Promise<void>(resolve => { finishFirst = resolve })
- const secondInstall = new Promise<void>(resolve => { finishSecond = resolve })
- vi.mocked(installHubSkill)
- .mockReturnValueOnce(firstInstall)
- .mockReturnValueOnce(secondInstall)
-
- const scopedView = (connectionId: string, profile: string) => (
- <QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/skills']}>
- <SkillsView embedded fixedConnection={connectionId} fixedProfile={profile} />
- </MemoryRouter>
- </QueryClientProvider>
+ // Refused with an informational toast, no install action spawned.
+ await waitFor(() =>
+ expect(vi.mocked(notify)).toHaveBeenCalledWith(
+ expect.objectContaining({ title: '"web-research" is already installed' })
+ )
)
- const view = render(scopedView('homelab', 'researcher'))
- fireEvent.click(screen.getByRole('button', { name: 'Browse' }))
- fireEvent.click(await screen.findByRole('button', { name: /^community-research/ }))
- fireEvent.click(screen.getByRole('button', { name: 'Install' }))
- const pending = screen.getByRole<HTMLButtonElement>('button', { name: 'Installing...' })
- expect(pending.disabled).toBe(true)
- expect(pending.querySelector('svg.animate-spin')).not.toBeNull()
- fireEvent.click(pending)
- expect(installHubSkill).toHaveBeenCalledExactlyOnceWith(identifier, {
- connectionId: 'homelab', profile: 'researcher'
- })
-
- fireEvent.click(screen.getByRole('button', { name: /^other-skill/ }))
- expect(screen.getByRole<HTMLButtonElement>('button', { name: 'Install' }).disabled).toBe(false)
- fireEvent.click(screen.getByRole('button', { name: /^community-research/ }))
- expect(screen.getByRole<HTMLButtonElement>('button', { name: 'Installing...' }).disabled).toBe(true)
-
- view.rerender(scopedView('other-gateway', 'writer'))
- fireEvent.click(await screen.findByRole('button', { name: /^community-research/ }))
- const nextInstall = screen.getByRole<HTMLButtonElement>('button', { name: 'Install' })
- expect(nextInstall.disabled).toBe(false)
- fireEvent.click(nextInstall)
- expect(installHubSkill).toHaveBeenNthCalledWith(2, identifier, {
- connectionId: 'other-gateway', profile: 'writer'
- })
-
- await act(async () => {
- finishFirst()
- await firstInstall
- })
- expect(screen.getByRole<HTMLButtonElement>('button', { name: 'Installing...' }).disabled).toBe(true)
- await act(async () => {
- finishSecond()
- await secondInstall
- })
- expect(screen.getByRole<HTMLButtonElement>('button', { name: 'Install' }).disabled).toBe(false)
- expect(installHubSkill).toHaveBeenCalledTimes(2)
})
- it('loads the public catalog only on Browse and reuses it across skills and tools tab switches', async () => {
- const fetchCatalog = vi.fn().mockResolvedValue({
- ok: true,
- json: async () => [{
- name: 'catalog-research',
- identifier: 'official/research/catalog-research',
- source: 'official',
- category: 'research',
- description: 'Research from the public snapshot'
- }]
- })
- vi.stubGlobal('fetch', fetchCatalog)
-
+ it('mounts the hub iframe lazily and keeps it (hidden) across tab switches', async () => {
+ // On a non-Skills tab the docs-site iframe must not exist at all — an
+ // eagerly mounted hub is exactly the Capabilities lag bug.
await renderSkills() // ?tab=toolsets
await screen.findByRole('switch', { name: 'Turn Web Search toolset off' })
- expect(fetchCatalog).not.toHaveBeenCalled()
+ expect(document.querySelector('iframe')).toBeNull()
cleanup()
+ // Embedded mode drives tabs through local state (the route hooks are
+ // mocked here), starting on Skills: the picker mounts with the tab.
await act(async () => {
render(
<QueryClientProvider client={queryClient}>
@@ -452,23 +330,19 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
)
})
- expect(screen.queryByRole('heading', { name: 'catalog-research' })).toBeNull()
- expect(fetchCatalog).not.toHaveBeenCalled()
- fireEvent.click(screen.getByRole('button', { name: 'Browse' }))
- expect(await screen.findByRole('heading', { name: 'catalog-research' })).toBeTruthy()
- expect(fetchCatalog).toHaveBeenCalledTimes(1)
- expect(fetchCatalog.mock.calls[0][0]).toMatch(/\/docs\/api\/skills\.json$/)
-
- fireEvent.click(screen.getByRole('button', { name: 'Installed' }))
- expect(screen.queryByRole('heading', { name: 'catalog-research' })).toBeNull()
- fireEvent.click(screen.getByRole('button', { name: 'Browse' }))
- expect(await screen.findByRole('heading', { name: 'catalog-research' })).toBeTruthy()
- fireEvent.click(screen.getByRole('button', { name: /^Tools/ }))
- await screen.findByRole('switch', { name: 'Turn Web Search toolset off' })
- expect(screen.queryByRole('heading', { name: 'catalog-research' })).toBeNull()
- fireEvent.click(screen.getByRole('button', { name: /^Skills/ }))
- expect(await screen.findByRole('heading', { name: 'catalog-research' })).toBeTruthy()
- expect(fetchCatalog).toHaveBeenCalledTimes(1)
+ const iframe = document.querySelector('iframe')
+ expect(iframe).toBeTruthy()
+ expect(iframe!.closest('section')!.classList.contains('hidden')).toBe(false)
+
+ // Switch to Tools → the iframe STAYS mounted (no docs-site reload on the
+ // next visit) but its section is fully hidden, so nothing from the hub
+ // can paint over the toolsets UI.
+ await act(async () => {
+ fireEvent.click(screen.getByRole('button', { name: /Tools/ }))
+ })
+ const kept = document.querySelector('iframe')
+ expect(kept).toBeTruthy()
+ expect(kept!.closest('section')!.classList.contains('hidden')).toBe(true)
})
it('shows a vision explainer that deep-links to Settings → Models', async () => {
@@ -571,8 +445,13 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
}
})
- it('offers optional skills through Browse and guards installed skills using the scoped installed list', async () => {
+ it('lists the built-in optional-skills catalog with Install buttons that route through the hub pipeline', async () => {
+ // The full official catalog renders BELOW the installed list; each row
+ // carries an Install button (no toggle until installed) that routes
+ // through the standard hub action pipeline scoped to the Capabilities
+ // profile. Already-installed catalog entries are filtered out.
const { installHubSkill } = await import('@/store/hub-actions')
+
getSkills.mockResolvedValue([
{
name: 'web-research',
@@ -583,54 +462,62 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
provenance: 'bundled'
}
])
- queryClient.setQueryData(['public-catalog', 'skills'], parseCatalog('skills', [
- {
- name: 'gif-search',
- description: 'Search GIFs',
- source: 'optional',
- installIdentifier: 'official/gifs/gif-search',
- category: 'gifs',
- tags: ['gifs']
- },
- {
- name: 'web-research',
- description: 'Research the web',
- source: 'optional',
- identifier: 'official/research/web-research',
- category: 'research'
- }
- ]))
+ getOfficialSkills.mockResolvedValue({
+ skills: [
+ {
+ name: 'gif-search',
+ description: 'Search GIFs',
+ identifier: 'official/gifs/gif-search',
+ category: 'gifs',
+ installed: false,
+ tags: ['gifs']
+ },
+ {
+ name: 'web-research',
+ description: 'already here under a different source',
+ identifier: 'official/research/web-research',
+ category: 'research',
+ installed: false,
+ tags: []
+ },
+ {
+ name: 'ascii-art',
+ description: 'ASCII art',
+ identifier: 'official/creative/ascii-art',
+ category: 'creative',
+ installed: true,
+ tags: []
+ }
+ ]
+ })
await act(async () => {
render(
<QueryClientProvider client={queryClient}>
<MemoryRouter initialEntries={['/skills?tab=skills']}>
- <SkillsView fixedProfile="researcher" />
+ <SkillsView />
</MemoryRouter>
</QueryClientProvider>
)
})
- expect(await screen.findByRole('switch', { name: 'web-research' })).toBeTruthy()
- expect(screen.queryByRole('button', { name: /^gif-search/ })).toBeNull()
- expect(screen.queryByRole('button', { name: 'Install' })).toBeNull()
- fireEvent.click(screen.getByRole('button', { name: 'Browse' }))
- fireEvent.click(await screen.findByRole('button', { name: /^web-research/ }))
-
- // Browse keeps installed entries discoverable, but never reinstallable.
- const detail = within(screen.getByRole('main'))
- const installed = detail.getByRole<HTMLButtonElement>('button', { name: 'Installed' })
- expect(installed.disabled).toBe(true)
- fireEvent.click(installed)
- expect(installHubSkill).not.toHaveBeenCalled()
- fireEvent.click(screen.getByRole('button', { name: /^gif-search/ }))
- expect(detail.getByRole('heading', { name: 'gif-search' })).toBeTruthy()
- expect(screen.queryByRole('switch')).toBeNull()
+ // Catalog section header + the one genuinely-available row. Rows already
+ // installed (lock flag OR name collision with the installed list) are gone.
+ expect(await screen.findByText('Available to install')).toBeTruthy()
+ expect(await screen.findByText('gif-search')).toBeTruthy()
+ expect(screen.queryByText('ascii-art')).toBeNull()
+
+ // The installed skill still shows its toggle; the catalog row shows
+ // Install instead of a switch.
+ expect(screen.getByRole('switch', { name: 'web-research' })).toBeTruthy()
+ const install = screen.getByRole('button', { name: 'Install' })
await act(async () => {
- fireEvent.click(detail.getByRole('button', { name: 'Install' }))
+ fireEvent.click(install)
})
- expect(installHubSkill).toHaveBeenCalledExactlyOnceWith('official/gifs/gif-search', 'researcher')
+ await waitFor(() =>
+ expect(vi.mocked(installHubSkill)).toHaveBeenCalledWith('official/gifs/gif-search', expect.anything())
+ )
})
})
diff --git a/apps/desktop/src/app/skills/index.tsx b/apps/desktop/src/app/skills/index.tsx
index 1f4675ec1fa..4a57291c58e 100644
--- a/apps/desktop/src/app/skills/index.tsx
+++ b/apps/desktop/src/app/skills/index.tsx
@@ -16,11 +16,13 @@ import type { DesktopRosterAgent } from '@/global'
import {
editLearningNode,
getLearningNode,
+ getOfficialSkills,
getProfiles,
getSkillContent,
getSkills,
getToolsets,
getUsageAnalytics,
+ previewSkillHub,
type ProfileScope,
profileScopeKey,
setSkillEnabled,
@@ -28,14 +30,17 @@ import {
} from '@/hermes'
import { useI18n } from '@/i18n'
import { isDesktopToolsetVisible } from '@/lib/desktop-toolsets'
+import { Loader2 } from '@/lib/icons'
import { queryClient } from '@/lib/query-client'
import { invalidateSlashCompletions } from '@/lib/slash-completion-cache'
import { normalize } from '@/lib/text'
import { useStoreSelector } from '@/lib/use-session-slice'
+import { cn } from '@/lib/utils'
import { $gateway, activeGatewayConnectionId } from '@/store/gateway'
+import { $hubActions, installHubSkill, notifyHubActionFailed, OFFICIAL_SKILLS_KEY } from '@/store/hub-actions'
import { notify, notifyError } from '@/store/notifications'
import { $activeGatewayProfile, normalizeProfileKey } from '@/store/profile'
-import type { SkillInfo, ToolsetInfo } from '@/types/hermes'
+import type { OfficialSkillInfo, SkillInfo, ToolsetInfo } from '@/types/hermes'
import { useOnProfileSwitch } from '../hooks/use-on-profile-switch'
import { useRefreshHotkey } from '../hooks/use-refresh-hotkey'
@@ -62,15 +67,14 @@ import { TerminalBackendPanel } from '../settings/terminal-backend-panel'
import { ToolsetConfigPanel } from '../settings/toolset-config-panel'
import type { SetStatusbarItemGroup } from '../shell/statusbar-controls'
-import { CapabilityTabs, type CapabilityView } from './capability-tabs'
+import { EmbeddedHubPicker } from './embedded-hub-picker'
import { McpTab } from './mcp-tab'
-import { PluginActions, PluginsTab } from './plugins-tab'
-import { SkillCatalog } from './skill-catalog'
+import { PluginsTab } from './plugins-tab'
import { $skillsSortDesc, $toolsetsSortDesc } from './store'
-import { UpdateSkillsButton } from './update-skills-button'
-// Skills Hub browsing lives inside the Skills tab. Legacy `?tab=hub`
-// links fall back to 'skills' via useRouteEnumParam.
+// 'hub' is gone as a top-level tab — the Skills Hub browser lives inside the
+// Skills tab now (EmbeddedHubPicker below the installed list). Legacy
+// `?tab=hub` links fall back to 'skills' via useRouteEnumParam.
const SKILLS_MODES = ['skills', 'toolsets', 'mcp', 'plugins'] as const
// Skills + toolsets live in the RQ cache so switching tabs/pages paints the
@@ -149,6 +153,23 @@ function filteredSkills(skills: SkillInfo[], query: string, desc: boolean): Skil
.sort((a, b) => sign * (usageOf(b) - usageOf(a)) || asText(a.name).localeCompare(asText(b.name)))
}
+// Catalog rows have no usage yet — plain A–Z, same query fields as installed
+// rows plus tags (the catalog's frontmatter tags are its richest search text).
+function filteredOfficial(skills: OfficialSkillInfo[], query: string): OfficialSkillInfo[] {
+ const q = normalize(query)
+
+ return skills
+ .filter(
+ skill =>
+ !q ||
+ includesQuery(skill.name, q) ||
+ includesQuery(skill.description, q) ||
+ includesQuery(skill.category, q) ||
+ skill.tags.some(tag => includesQuery(tag, q))
+ )
+ .sort((a, b) => asText(a.name).localeCompare(asText(b.name)))
+}
+
const toolsetCalls = (toolset: ToolsetInfo, toolCalls: Record<string, number>): number =>
toolNames(toolset).reduce((sum, name) => sum + (toolCalls[name] ?? 0), 0)
@@ -224,7 +245,16 @@ export function SkillsView({
const [query, setQuery] = useState('')
- const [capabilityView, setCapabilityView] = useState<CapabilityView>('installed')
+ // The hub picker hosts a full docs-site iframe — the single most expensive
+ // thing on this page. It mounts lazily (first time the Skills tab is shown)
+ // and then STAYS mounted but hidden across tab switches, so bouncing to
+ // Tools/MCP and back never reloads the site. Derived-state pattern: flips
+ // once, during render, never back.
+ const [hubMounted, setHubMounted] = useState(mode === 'skills')
+
+ if (mode === 'skills' && !hubMounted) {
+ setHubMounted(true)
+ }
// Capabilities scope selector: which profile's Skills/Tools/MCP config we're
// editing — and on WHICH gateway. A profile belongs to one gateway, so on a
@@ -307,6 +337,17 @@ export function SkillsView({
staleTime: 0
})
+ // The built-in optional-skills catalog (optional-skills/ shipped with the
+ // repo) — rendered under the installed list with install buttons. Local
+ // checkout scan on the backend, so it's cheap; failures (older backend
+ // without the endpoint) just render no catalog rows.
+ const { data: officialData } = useQuery({
+ queryKey: [...OFFICIAL_SKILLS_KEY, scopeKey],
+ queryFn: () => getOfficialSkills(scopeProfile),
+ staleTime: 60_000,
+ retry: false
+ })
+
// Optimistic write-through against the scoped Skills key: toggles/bulk/
// archive repaint instantly; the next background refetch reconciles.
const setSkills = useCallback(
@@ -325,12 +366,16 @@ export function SkillsView({
const toolsetsSortDesc = useStore($toolsetsSortDesc)
const [bulkBusy, setBulkBusy] = useState(false)
const [selectedSkill, setSelectedSkill] = useState<string | null>(null)
+ // Catalog selection is separate from installed-skill selection: identifiers
+ // (official/<category>/<name>) vs names. Non-null wins the detail pane.
+ const [selectedOfficial, setSelectedOfficial] = useState<string | null>(null)
const [selectedToolset, setSelectedToolset] = useState<string | null>(null)
const refreshCapabilities = useCallback(async () => {
await Promise.all([
queryClient.invalidateQueries({ queryKey: SKILLS_QUERY_KEY }),
- queryClient.invalidateQueries({ queryKey: TOOLSETS_QUERY_KEY })
+ queryClient.invalidateQueries({ queryKey: TOOLSETS_QUERY_KEY }),
+ queryClient.invalidateQueries({ queryKey: OFFICIAL_SKILLS_KEY })
])
invalidateSlashCompletions()
@@ -388,6 +433,7 @@ export function SkillsView({
toolCallsEpoch.current += 1
setToolCalls(null)
setScopeOverride(null)
+ setSelectedOfficial(null)
})
const visibleSkills = useMemo(
@@ -395,10 +441,30 @@ export function SkillsView({
[query, skills, skillsSortDesc]
)
- // Installed-name set for the catalog's already-installed guard — the
+ // Installed-name set for the hub picker's already-installed guard — the
// UNFILTERED list on purpose (search must not make a skill look absent).
const installedSkillNames = useMemo(() => new Set((skills ?? []).map(s => s.name)), [skills])
+ // Catalog rows still available to install: drop entries whose lock says
+ // installed AND entries whose name already appears in the installed list
+ // (covers installs from before the lock existed, or by hand).
+ const visibleOfficial = useMemo(() => {
+ const catalog = (officialData?.skills ?? []).filter(s => !s.installed && !installedSkillNames.has(s.name))
+
+ return filteredOfficial(catalog, query)
+ }, [installedSkillNames, officialData, query])
+
+ // Identifiers with a hub install currently running — selected as a joined
+ // string so $hubActions' per-log-line churn doesn't re-render the list.
+ const runningInstallKey = useStoreSelector($hubActions, actions =>
+ Object.keys(actions)
+ .filter(key => actions[key]?.running)
+ .sort()
+ .join('|')
+ )
+
+ const runningInstalls = useMemo(() => new Set(runningInstallKey.split('|').filter(Boolean)), [runningInstallKey])
+
const visibleToolsets = useMemo(
() => (toolsets ? filteredToolsets(toolsets, query, toolCalls ?? {}, toolsetsSortDesc) : []),
[query, toolCalls, toolsets, toolsetsSortDesc]
@@ -444,6 +510,13 @@ export function SkillsView({
[selectedSkill, visibleSkills]
)
+ // A selected catalog row wins the detail pane; it clears when filtered out
+ // (or when its install finishes and the row leaves the catalog list).
+ const activeOfficial = useMemo(
+ () => visibleOfficial.find(s => s.identifier === selectedOfficial) ?? null,
+ [selectedOfficial, visibleOfficial]
+ )
+
const activeToolset = useMemo(
() => visibleToolsets.find(ts => ts.name === selectedToolset) ?? visibleToolsets[0] ?? null,
[selectedToolset, visibleToolsets]
@@ -468,6 +541,18 @@ export function SkillsView({
}
}
+ // Catalog install: routes through the standard hub action pipeline
+ // (background action + tailed log + query invalidation), same as the
+ // embedded hub picker — the row's button spins off ITS $hubActions entry
+ // and the finished install refetches both lists, flipping the row from the
+ // catalog section into the installed section with the normal toggle.
+ function handleInstallOfficial(skill: OfficialSkillInfo) {
+ notify({ kind: 'success', title: t.skills.hub.installStarted(skill.name), message: t.skills.hub.actionLog })
+ void installHubSkill(skill.identifier, scopeProfile).catch(err =>
+ notifyHubActionFailed(err, t.skills.hub.actionFailed, skill.name, scopeProfile)
+ )
+ }
+
async function handleToggleToolset(toolset: ToolsetInfo, enabled: boolean) {
const scopedToolsetKey = [...TOOLSETS_QUERY_KEY, scopeKey]
@@ -693,6 +778,7 @@ export function SkillsView({
setSkillEditor(null)
setSkillDraft('')
setArchiveTarget(null)
+ setSelectedOfficial(null)
}
// Scope-selector rows. Multi-connection desktops list every reachable
@@ -738,18 +824,25 @@ export function SkillsView({
// Browse Hub). Lets the user configure ANY profile's capabilities — on any
// registered gateway — without switching the whole app. Only meaningful
// with >1 option; hidden otherwise to avoid clutter.
- // Keep the selector in the same slot across tabs. Plugins labels its scope
- // as Agent because desktop halves belong to the app, not this profile.
+ // Plugins embeds the selector in its Agent-column header (compact, no label,
+ // no border): desktop halves on that page are app-level and must not read as
+ // governed by "Configuring: <profile>".
+ const compactSelector = mode === 'plugins'
const scopeLabel = scopeOptions.find(option => option.value === scopeSelectValue)?.label
const profileScopeSelector =
scopeOptions.length > 1 ? (
<div
- className="flex min-w-0 items-center gap-2 border-b border-(--ui-stroke-secondary) px-3 py-2"
+ className={cn(
+ 'flex min-w-0 items-center gap-2',
+ compactSelector ? 'flex-1' : 'border-b border-(--ui-stroke-secondary) px-3 py-2'
+ )}
>
- <span className="text-[0.7rem] font-medium text-(--ui-text-tertiary)">{mode === 'plugins' ? t.skills.plugins.halfAgent : t.skills.configuringProfile}</span>
+ {!compactSelector && (
+ <span className="text-[0.7rem] font-medium text-(--ui-text-tertiary)">{t.skills.configuringProfile}</span>
+ )}
<Select onValueChange={changeScope} value={scopeSelectValue}>
- <SelectTrigger className="h-7 w-56 text-xs">
+ <SelectTrigger className={cn('text-xs', compactSelector ? 'h-6 w-full max-w-64 px-2' : 'h-7 w-56')}>
<SelectValue />
</SelectTrigger>
<SelectContent>
@@ -771,9 +864,9 @@ export function SkillsView({
onTabChange={id => setMode(id as (typeof SKILLS_MODES)[number])}
// MCP manages a handful of entries with the editor right there —
// searching it is noise.
- searchHidden={mode === 'mcp'}
+ searchHidden={mode === 'mcp' || mode === 'plugins'}
searchHints={searchHints}
- searchPlaceholder={mode === 'plugins' ? t.catalog.searchPlugins : mode === 'skills' ? t.catalog.searchSkills : t.skills.searchToolsets}
+ searchPlaceholder={mode === 'skills' ? t.skills.searchSkills : t.skills.searchToolsets}
searchValue={query}
tabs={[
{ id: 'skills', label: t.skills.tabSkills, meta: skills?.length ?? null },
@@ -786,28 +879,22 @@ export function SkillsView({
active, so Skills / Tools / MCP all read and write the SAME selected
profile. */}
<div className="flex h-full flex-col">
- {profileScopeSelector}
- {(mode === 'skills' || mode === 'plugins') && (
- <CapabilityTabs
- actions={mode === 'skills' ? <UpdateSkillsButton profile={scopeProfile} /> : <PluginActions profile={scopeProfile} />}
- onChange={setCapabilityView}
- value={capabilityView}
- />
- )}
+ {/* Plugins renders the selector INSIDE its agent section: desktop
+ plugins on that page belong to the app, not to any profile, and
+ must not sit under a "Configuring: <profile>" header. */}
+ {mode !== 'plugins' && profileScopeSelector}
<div className="flex min-h-0 flex-1 flex-col">
- <div className="min-h-0 flex-1 overflow-hidden">
+ <div className={mode === 'skills' ? 'min-h-40 flex-1 overflow-hidden' : 'min-h-0 flex-1'}>
{mode === 'plugins' ? (
// Agent plugins for the scoped profile (selector in the section
- // header), app-level desktop plugins, and the native catalog
+ // header), app-level desktop plugins, the live catalog picker
// underneath. Keyed on scope so a profile/connection switch
// reloads the agent list.
<PluginsTab
key={`plugins-${scopeKey}`}
- onQueryChange={setQuery}
profile={scopeProfile}
- query={query}
scopeLabel={scopeLabel}
- view={capabilityView}
+ scopeSelector={profileScopeSelector}
/>
) : mode === 'mcp' ? (
// The gateway instance backs ONLY the live `reload.mcp` RPC, and
@@ -816,8 +903,6 @@ export function SkillsView({
// machine's MCP servers, so it is withheld (config edits still
// apply on that backend's next session).
<McpTab gateway={crossBackendScope ? null : gateway} key={`mcp-${scopeKey}`} profile={scopeProfile} />
- ) : mode === 'skills' && capabilityView === 'browse' ? (
- <SkillCatalog installedNames={installedSkillNames} key={scopeKey} onQueryChange={setQuery} profile={scopeProfile} query={query} />
) : (skillsFailed || toolsetsFailed) && (!skills || !toolsets) ? (
<PanelEmpty
action={
@@ -832,7 +917,13 @@ export function SkillsView({
) : !skills || !toolsets ? (
<PageLoader label={t.skills.loading} />
) : mode === 'skills' ? (
- visibleSkills.length === 0 ? (
+ // Installed skills on top, the Skills Hub browser underneath —
+ // discovery sits with management. The list region keeps a floor
+ // (min-h-40, on the wrapper above) so a tall hub viewport or a
+ // short window shrinks the HUB, never the list: the sort strip
+ // and "changes apply" footer can no longer be starved to 0px
+ // and painted over by the hub header.
+ visibleSkills.length === 0 && visibleOfficial.length === 0 ? (
capabilityEmpty('skills')
) : (
<MasterDetail pane={skillEditorPane} resizeId="capabilities-split" split="wide">
@@ -858,27 +949,73 @@ export function SkillsView({
>
{visibleSkills.map(skill => (
<CapRow
- active={activeSkill?.name === skill.name}
+ active={activeOfficial === null && activeSkill?.name === skill.name}
busy={bulkBusy}
enabled={skill.enabled}
key={skill.name}
meta={usageOf(skill) > 0 ? `×${compactNumber(usageOf(skill))}` : undefined}
- onSelect={() => setSelectedSkill(skill.name)}
+ onSelect={() => {
+ setSelectedSkill(skill.name)
+ setSelectedOfficial(null)
+ }}
onToggle={enabled => void handleToggleSkill(skill, enabled)}
subtitle={skillSubtitle(skill)}
title={skill.name}
toggleLabel={skill.name}
/>
))}
+ {/* The built-in optional-skills catalog, below the
+ installed list: every official skill Hermes ships but
+ hasn't installed yet, with a one-click install that
+ flips the row into the installed section above. */}
+ {visibleOfficial.length > 0 && (
+ <div className="flex h-7 shrink-0 items-end px-2 pb-1 text-[0.62rem] font-medium uppercase tracking-wide text-(--ui-text-quaternary)">
+ {t.skills.officialCatalog}
+ </div>
+ )}
+ {visibleOfficial.map(skill => {
+ const installing = runningInstalls.has(skill.identifier)
+
+ return (
+ <CapRow
+ action={
+ <Button
+ disabled={installing}
+ onClick={() => handleInstallOfficial(skill)}
+ size="xs"
+ variant="text"
+ >
+ {installing && <Loader2 className="size-3 animate-spin" />}
+ {installing ? t.skills.hub.installing : t.skills.hub.install}
+ </Button>
+ }
+ active={activeOfficial?.identifier === skill.identifier}
+ enabled={false}
+ key={skill.identifier}
+ onSelect={() => setSelectedOfficial(skill.identifier)}
+ subtitle={prettyName(skill.category)}
+ title={skill.name}
+ />
+ )
+ })}
</ListColumn>
<DetailColumn footer={t.skills.changesApplyNewSessions}>
- {activeSkill && (
- <SkillDetail
- onArchive={() => setArchiveTarget(activeSkill.name)}
- onEdit={() => void openSkillEditor(activeSkill.name)}
+ {activeOfficial ? (
+ <OfficialSkillDetail
+ installing={runningInstalls.has(activeOfficial.identifier)}
+ onInstall={() => handleInstallOfficial(activeOfficial)}
profile={scopeProfile}
- skill={activeSkill}
+ skill={activeOfficial}
/>
+ ) : (
+ activeSkill && (
+ <SkillDetail
+ onArchive={() => setArchiveTarget(activeSkill.name)}
+ onEdit={() => void openSkillEditor(activeSkill.name)}
+ profile={scopeProfile}
+ skill={activeSkill}
+ />
+ )
)}
</DetailColumn>
</MasterDetail>
@@ -936,6 +1073,15 @@ export function SkillsView({
</MasterDetail>
)}
</div>
+ {/* Hub picker OUTSIDE the tab ternary: it lazy-mounts the first time
+ Skills is shown, then stays mounted (hidden) across Tools/MCP so
+ the docs-site iframe never reloads on a tab bounce. No scope key
+ on purpose — the picker fetches nothing; scope rides the
+ `profile` prop into each install call, and remounting on scope
+ change would reload the whole site for no data benefit. */}
+ {hubMounted && (
+ <EmbeddedHubPicker hidden={mode !== 'skills'} installedNames={installedSkillNames} profile={scopeProfile} />
+ )}
</div>
</div>
{archiveTarget && (
@@ -1117,6 +1263,76 @@ function SkillDetail({
)
}
+// Detail pane for a not-yet-installed catalog skill: metadata + full SKILL.md
+// via the hub preview endpoint (same resolver an install uses), plus the same
+// install button as the row.
+function OfficialSkillDetail({
+ installing,
+ onInstall,
+ profile,
+ skill
+}: {
+ installing: boolean
+ onInstall: () => void
+ profile?: ProfileScope
+ skill: OfficialSkillInfo
+}) {
+ const { t } = useI18n()
+
+ const previewQuery = useQuery({
+ queryKey: ['official-skill-preview', skill.identifier, profileScopeKey(profile)],
+ queryFn: () => previewSkillHub(skill.identifier, profile),
+ staleTime: 5 * 60_000,
+ retry: false
+ })
+
+ const parsed = useMemo(
+ () => (previewQuery.data?.skill_md ? parseFrontmatter(previewQuery.data.skill_md) : null),
+ [previewQuery.data]
+ )
+
+ return (
+ <>
+ <DetailHeader
+ description={asText(skill.description) || t.skills.noDescription}
+ pills={
+ <>
+ <PanelPill>{prettyName(skill.category)}</PanelPill>
+ <PanelPill tone="muted">{t.skills.officialPill}</PanelPill>
+ </>
+ }
+ title={skill.name}
+ />
+ <div className="flex items-center gap-2">
+ <Button disabled={installing} onClick={onInstall} size="xs" variant="textStrong">
+ {installing && <Loader2 className="size-3 animate-spin" />}
+ {installing ? t.skills.hub.installing : t.skills.hub.install}
+ </Button>
+ </div>
+ {parsed && parsed.meta.length > 0 && (
+ <div className="grid gap-1 rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) p-3">
+ {parsed.meta.map(([key, value]) => (
+ <div className="flex gap-2 text-[0.68rem] leading-4" key={key}>
+ <span className="w-24 shrink-0 font-medium text-(--ui-text-tertiary)">{key}</span>
+ <span className="min-w-0 whitespace-pre-wrap break-words text-(--ui-text-secondary)">{value}</span>
+ </div>
+ ))}
+ </div>
+ )}
+ {previewQuery.isLoading ? (
+ <CountSkeleton />
+ ) : parsed ? (
+ <pre
+ className="overflow-auto whitespace-pre-wrap wrap-break-word rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) p-3 font-mono text-[0.68rem] leading-relaxed"
+ data-selectable-text="true"
+ >
+ {parsed.body.trim() || t.skills.noDescription}
+ </pre>
+ ) : null}
+ </>
+ )
+}
+
function ToolsetDetail({
toolset,
toolCalls,
diff --git a/apps/desktop/src/app/skills/plugins-tab.test.tsx b/apps/desktop/src/app/skills/plugins-tab.test.tsx
index d6987e4e31d..219ea3686af 100644
--- a/apps/desktop/src/app/skills/plugins-tab.test.tsx
+++ b/apps/desktop/src/app/skills/plugins-tab.test.tsx
@@ -1,21 +1,15 @@
-import { QueryClientProvider } from '@tanstack/react-query'
-import { act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
-import { type ComponentProps, useState } from 'react'
+import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { $pluginRecords } from '@/contrib/plugins-store'
-import { queryClient } from '@/lib/query-client'
import { $agentPlugins, $agentPluginsStatus } from '@/store/agent-plugins'
+import { $paneHeightOverride, setPaneHeightOverride } from '@/store/panes'
import { $pluginInstallRequest, closePluginInstallRequest } from '@/store/plugin-install-request'
import { $connection } from '@/store/session'
-import { PageSearchShell } from '../page-search-shell'
+import { PluginsTab } from './plugins-tab'
-import { CapabilityTabs } from './capability-tabs'
-import { parseCatalog } from './catalog-data'
-import { PluginActions, PluginsTab } from './plugins-tab'
-
-const requestGateway = vi.fn(async () => ({ plugins: $agentPlugins.get() }))
+const requestGateway = vi.fn(async () => ({ plugins: [] }))
const connectionFixture = {
baseUrl: 'http://localhost',
@@ -27,59 +21,6 @@ const connectionFixture = {
wsUrl: ''
}
-// SkillsView owns navigation and search; exercise that controlled contract
-// with the same primitives instead of giving PluginsTab private controls.
-function PluginsHarness({
- view: initialView = 'installed',
- query: initialQuery = '',
- ...props
-}: ComponentProps<typeof PluginsTab>) {
- const [view, setView] = useState(initialView)
- const [query, setQuery] = useState(initialQuery)
-
- return (
- <PageSearchShell onSearchChange={setQuery} searchPlaceholder="Search plugins" searchValue={query}>
- <CapabilityTabs actions={<PluginActions profile={props.profile} />} onChange={setView} value={view} />
- <PluginsTab {...props} onQueryChange={setQuery} query={query} view={view} />
- </PageSearchShell>
- )
-}
-
-function renderPlugins(props: ComponentProps<typeof PluginsTab>) {
- return render(
- <QueryClientProvider client={queryClient}>
- <PluginsHarness {...props} />
- </QueryClientProvider>
- )
-}
-
-const weatherEntry = {
- name: 'weather-plugin',
- repo: 'https://github.com/example/weather-plugin',
- sha: 'a'.repeat(40),
- subdir: '',
- tier: 'community',
- category: 'weather',
- description: 'Local weather forecasts'
-}
-
-function seedCatalog(entries = [weatherEntry]) {
- queryClient.setQueryData(['public-catalog', 'plugins'], parseCatalog('plugins', entries))
-}
-
-async function selectCatalogEntry(name: string) {
- fireEvent.click(screen.getByRole('button', { name: 'Browse' }))
- fireEvent.click(await screen.findByRole('button', { name: text => text.startsWith(name) }))
- expect(screen.getByRole('heading', { name })).toBeTruthy()
-}
-
-afterEach(() => {
- cleanup()
- $connection.set(null)
- queryClient.clear()
- vi.unstubAllGlobals()
-})
-
vi.mock('@/app/gateway/hooks/use-gateway-request', () => ({
useGatewayRequest: () => ({ requestGateway })
}))
@@ -90,8 +31,12 @@ describe('PluginsTab', () => {
$agentPlugins.set([])
$agentPluginsStatus.set('ready')
closePluginInstallRequest()
- requestGateway.mockReset()
- requestGateway.mockImplementation(async () => ({ plugins: $agentPlugins.get() }))
+ requestGateway.mockClear()
+ })
+
+ afterEach(() => {
+ cleanup()
+ $connection.set(null)
})
it('lists the scoped profile agent plugins with toggles', () => {
@@ -106,11 +51,10 @@ describe('PluginsTab', () => {
}
])
- renderPlugins({ profile: 'workbot' })
+ render(<PluginsTab profile="workbot" />)
- expect(screen.getByRole('button', { name: /^demo-plugin/, pressed: true })).toBeTruthy()
- const detail = within(screen.getByRole('row', { name: /^demo-plugin/ }))
- expect(detail.getByRole('switch', { name: 'Agent: demo-plugin' }).getAttribute('aria-checked')).toBe('true')
+ expect(screen.getByText('demo-plugin')).toBeTruthy()
+ expect(screen.getByRole('switch', { name: 'Agent: demo-plugin' }).getAttribute('aria-checked')).toBe('true')
})
it('hides bundled plugins (managed from their own surfaces)', () => {
@@ -125,11 +69,10 @@ describe('PluginsTab', () => {
}
])
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
expect(screen.queryByText('fal')).toBeNull()
- expect(screen.queryByRole('row')).toBeNull()
- expect(screen.getByText('No matches')).toBeTruthy()
+ expect(screen.getByText(/No plugins yet/)).toBeTruthy()
})
// A desktop half can only be copied out of a backend that runs on THIS
@@ -149,7 +92,7 @@ describe('PluginsTab', () => {
}
])
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
const detail = within(screen.getByRole('row', { name: /^nous-prices/ }))
expect(detail.getByText('unavailable (remote backend)')).toBeTruthy()
@@ -169,7 +112,7 @@ describe('PluginsTab', () => {
}
])
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
const detail = within(screen.getByRole('row', { name: /^nous-prices/ }))
expect(detail.getByText('copying…')).toBeTruthy()
@@ -191,15 +134,13 @@ describe('PluginsTab', () => {
}
])
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
- expect(screen.getAllByRole('button', { name: /^Media Studio/ })).toHaveLength(1)
- expect(screen.getAllByRole('row')).toHaveLength(1)
- const detail = within(screen.getByRole('row', { name: /^Media Studio/ }))
- expect(detail.getByText('Agent + Desktop')).toBeTruthy()
- expect(detail.getByRole('switch', { name: 'Desktop: Media Studio' }).getAttribute('aria-checked')).toBe('true')
- expect(detail.getByRole('switch', { name: 'Agent: Media Studio' }).getAttribute('aria-checked')).toBe('false')
- expect(detail.getByRole('cell', { name: 'Agent in workbot' })).toBeTruthy()
+ expect(screen.getAllByTestId(/^plugin-row-/)).toHaveLength(1)
+ expect(screen.getByText('Agent + Desktop')).toBeTruthy()
+ expect(screen.getByRole('switch', { name: 'Desktop: Media Studio' }).getAttribute('aria-checked')).toBe('true')
+ expect(screen.getByRole('switch', { name: 'Agent: Media Studio' }).getAttribute('aria-checked')).toBe('false')
+ expect(screen.getAllByText('Agent in workbot').length).toBeGreaterThan(0)
})
it('offers "Install here" for a desktop half whose agent half is not in the selected profile', async () => {
@@ -214,7 +155,7 @@ describe('PluginsTab', () => {
}
})
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
expect(screen.queryByRole('switch', { name: /^Agent:/ })).toBeNull()
screen.getByRole('button', { name: 'Install here' }).click()
@@ -234,13 +175,13 @@ describe('PluginsTab', () => {
media: { id: 'media', name: 'Media Studio', kind: 'disk', status: 'loaded', packageName: 'hermes-media-studio' }
})
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
expect((screen.getByRole('button', { name: 'Install here' }) as HTMLButtonElement).disabled).toBe(true)
})
it('loads the plugin list scoped to the selected profile', () => {
- renderPlugins({ profile: 'workbot' })
+ render(<PluginsTab profile="workbot" />)
expect(requestGateway).toHaveBeenCalledWith(
'plugins.manage',
@@ -248,25 +189,51 @@ describe('PluginsTab', () => {
)
})
- it('opens the dual-target install modal for the selected catalog entry in the scoped profile', async () => {
- seedCatalog([
- { ...weatherEntry, name: 'other-plugin', repo: 'https://github.com/example/other-plugin' },
- weatherEntry
- ])
- renderPlugins({ profile: 'workbot' })
+ it('opens the dual-target install modal from a catalog pick message', async () => {
+ render(<PluginsTab profile="workbot" />)
+
+ window.dispatchEvent(
+ new MessageEvent('message', {
+ data: {
+ name: 'weather-plugin',
+ repo: 'https://github.com/example/weather-plugin',
+ sha: 'a'.repeat(40),
+ subdir: '',
+ tier: 'community',
+ type: 'hermes-plugin-pick'
+ },
+ origin: 'https://hermes-agent.nousresearch.com'
+ })
+ )
- await selectCatalogEntry(weatherEntry.name)
- expect($pluginInstallRequest.get()).toBeNull()
- fireEvent.click(screen.getByRole('button', { name: 'Install' }))
+ await waitFor(() => {
+ const request = $pluginInstallRequest.get()
- expect($pluginInstallRequest.get()).toMatchObject({
- catalogName: weatherEntry.name,
- repo: weatherEntry.repo,
- profile: 'workbot',
- sha: weatherEntry.sha
+ expect(request).not.toBeNull()
+ expect(request?.catalogName).toBe('weather-plugin')
+ expect(request?.repo).toBe('https://github.com/example/weather-plugin')
+ expect(request?.profile).toBe('workbot')
+ expect(request?.sha).toBe('a'.repeat(40))
})
})
+ it('ignores pick messages from foreign origins', () => {
+ render(<PluginsTab profile={null} />)
+
+ window.dispatchEvent(
+ new MessageEvent('message', {
+ data: {
+ name: 'evil-plugin',
+ repo: 'https://github.com/evil/evil-plugin',
+ type: 'hermes-plugin-pick'
+ },
+ origin: 'https://evil.example.com'
+ })
+ )
+
+ expect($pluginInstallRequest.get()).toBeNull()
+ })
+
it('toggles by canonical key through plugins.manage', async () => {
$agentPlugins.set([
{
@@ -283,7 +250,7 @@ describe('PluginsTab', () => {
plugin: { key: 'image_gen/legacy', name: 'Legacy plugin', status: 'enabled' }
} as never)
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
screen.getByRole('switch', { name: 'Agent: Legacy plugin' }).click()
@@ -308,7 +275,7 @@ describe('PluginsTab', () => {
}
])
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
const toggle = screen.getByRole('switch', { name: 'Agent: Legacy plugin' })
@@ -319,24 +286,23 @@ describe('PluginsTab', () => {
expect(requestGateway).not.toHaveBeenCalledWith('plugins.manage', expect.objectContaining({ action: 'toggle' }))
})
- it('appends the selected subdir for multi-plugin repos without changing its catalog pin', async () => {
- const entry = {
- ...weatherEntry,
- name: 'nested-plugin',
- repo: 'https://github.com/example/plugins-monorepo',
- subdir: 'packages/nested-plugin'
- }
- seedCatalog([entry])
- renderPlugins({ profile: null })
-
- await selectCatalogEntry(entry.name)
- fireEvent.click(screen.getByRole('button', { name: 'Install' }))
-
- expect($pluginInstallRequest.get()).toMatchObject({
- catalogName: entry.name,
- repo: `${entry.repo}#${entry.subdir}`,
- profile: null,
- sha: entry.sha
+ it('appends the subdir fragment for multi-plugin repos', async () => {
+ render(<PluginsTab profile={null} />)
+
+ window.dispatchEvent(
+ new MessageEvent('message', {
+ data: {
+ name: 'nested-plugin',
+ repo: 'https://github.com/example/plugins-monorepo',
+ subdir: 'nested-plugin',
+ type: 'hermes-plugin-pick'
+ },
+ origin: 'https://hermes-agent.nousresearch.com'
+ })
+ )
+
+ await waitFor(() => {
+ expect($pluginInstallRequest.get()?.repo).toBe('https://github.com/example/plugins-monorepo#nested-plugin')
})
})
})
@@ -346,63 +312,30 @@ describe('PluginsTab catalog UX', () => {
$agentPlugins.set([])
$agentPluginsStatus.set('ready')
closePluginInstallRequest()
- requestGateway.mockReset()
- requestGateway.mockImplementation(async () => ({ plugins: $agentPlugins.get() }))
- $pluginRecords.set({})
+ requestGateway.mockClear()
+ setPaneHeightOverride('capabilities-plugin-catalog', undefined)
})
- it('fetches only on Browse, with no extra requests for selection, search, or tab bounce', async () => {
- const fetchCatalog = vi.fn().mockResolvedValue({
- ok: true,
- json: async () => [weatherEntry, { ...weatherEntry, name: 'garden-plugin', category: 'garden', description: 'Garden planning' }]
- })
- vi.stubGlobal('fetch', fetchCatalog)
- await act(async () => { renderPlugins({ profile: null }) })
-
- expect(fetchCatalog).not.toHaveBeenCalled()
- expect(screen.queryByRole('heading', { name: weatherEntry.name })).toBeNull()
- await selectCatalogEntry('garden-plugin')
- const search = screen.getByRole<HTMLInputElement>('textbox', { name: 'Search plugins' })
- fireEvent.change(search, { target: { value: 'weather' } })
- expect(await screen.findByRole('heading', { name: weatherEntry.name })).toBeTruthy()
- expect(screen.queryByRole('button', { name: /^garden-plugin/ })).toBeNull()
- fireEvent.click(screen.getByRole('button', { name: 'Installed', pressed: false }))
- expect(screen.queryByRole('heading', { name: weatherEntry.name })).toBeNull()
- // The parent retains the shared search across navigation. Clearing from
- // the empty state must propagate through onQueryChange, not local state.
- expect(search.value).toBe('weather')
- fireEvent.click(screen.getByRole('button', { name: 'Clear filters' }))
- expect(search.value).toBe('')
- await selectCatalogEntry('garden-plugin')
-
- expect(fetchCatalog).toHaveBeenCalledTimes(1)
- expect(fetchCatalog.mock.calls[0][0]).toMatch(/\/docs\/api\/plugins\.json$/)
- expect(fetchCatalog.mock.calls[0][1]).toMatchObject({ credentials: 'omit' })
- expect($pluginInstallRequest.get()).toBeNull()
- })
+ afterEach(cleanup)
- it('offers an explicit retry after a catalog failure rather than refetching on tab bounce', async () => {
- const fetchCatalog = vi.fn()
- .mockResolvedValueOnce({ ok: false, status: 503 })
- .mockResolvedValue({ ok: true, json: async () => [weatherEntry] })
- vi.stubGlobal('fetch', fetchCatalog)
- await act(async () => { renderPlugins({ profile: null }) })
- fireEvent.click(screen.getByRole('button', { name: 'Browse' }))
-
- expect(await screen.findByText('Catalog HTTP 503')).toBeTruthy()
- expect(fetchCatalog).toHaveBeenCalledTimes(1)
- await act(async () => {
- fireEvent.click(screen.getByRole('button', { name: /^Installed/ }))
- })
- await act(async () => {
- fireEvent.click(screen.getByRole('button', { name: 'Browse' }))
- })
- expect(fetchCatalog).toHaveBeenCalledTimes(1)
- expect(screen.getByText('Catalog HTTP 503')).toBeTruthy()
- fireEvent.click(screen.getByRole('button', { name: 'Try again' }))
+ it('grows the catalog when its top-edge sash is dragged up, and resets on double-click', () => {
+ // jsdom has no layout: give the Capabilities column a real height so the
+ // "never crush the lists above" clamp has something to clamp against.
+ const clientHeight = vi.spyOn(HTMLElement.prototype, 'clientHeight', 'get').mockReturnValue(900)
+ Object.defineProperty(window, 'innerHeight', { configurable: true, value: 1000 })
+ render(<PluginsTab profile={null} />)
+ const sash = screen.getByTestId('plugin-catalog-sash')
+
+ fireEvent.pointerDown(sash, { button: 0, clientY: 600 })
+ fireEvent.pointerMove(window, { clientY: 400 })
+ fireEvent.pointerUp(window)
+
+ // Default 380px + 200px of upward drag (clamped only by window/column size).
+ expect($paneHeightOverride('capabilities-plugin-catalog').get()).toBe(580)
- expect(await screen.findByRole('heading', { name: weatherEntry.name })).toBeTruthy()
- expect(fetchCatalog).toHaveBeenCalledTimes(2)
+ fireEvent.doubleClick(sash)
+ expect($paneHeightOverride('capabilities-plugin-catalog').get()).toBeUndefined()
+ clientHeight.mockRestore()
})
it('shows an Update chip when the catalog pin moved past the installed SHA', () => {
@@ -422,7 +355,7 @@ describe('PluginsTab catalog UX', () => {
}
])
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
expect(screen.getByRole('button', { name: `Update to ${'b'.repeat(8)}` })).toBeTruthy()
})
@@ -445,7 +378,7 @@ describe('PluginsTab catalog UX', () => {
])
requestGateway.mockResolvedValue({ ok: true, unchanged: false, plugins: [] } as never)
- renderPlugins({ profile: 'workbot' })
+ render(<PluginsTab profile="workbot" />)
screen.getByRole('button', { name: `Update to ${'b'.repeat(8)}` }).click()
@@ -457,7 +390,7 @@ describe('PluginsTab catalog UX', () => {
)
})
- it('disables installation of a catalog entry that is already installed and current', async () => {
+ it('refuses a catalog pick that is already installed and current', async () => {
$agentPlugins.set([
{
catalog_name: 'demo-weather',
@@ -472,17 +405,25 @@ describe('PluginsTab catalog UX', () => {
}
])
- seedCatalog([{ ...weatherEntry, name: 'demo-weather' }])
- await act(async () => { renderPlugins({ profile: null }) })
- await selectCatalogEntry('demo-weather')
+ render(<PluginsTab profile={null} />)
+
+ window.dispatchEvent(
+ new MessageEvent('message', {
+ data: {
+ name: 'demo-weather',
+ repo: 'https://github.com/example/demo-weather',
+ type: 'hermes-plugin-pick'
+ },
+ origin: 'https://hermes-agent.nousresearch.com'
+ })
+ )
- const installed = within(screen.getByRole('main')).getByRole<HTMLButtonElement>('button', { name: 'Installed' })
- expect(installed.disabled).toBe(true)
- fireEvent.click(installed)
+ // The modal must NOT open — the pick is refused with a toast.
+ await new Promise(resolve => setTimeout(resolve, 20))
expect($pluginInstallRequest.get()).toBeNull()
})
- it('offers catalog installation for an installed entry when an update is available', async () => {
+ it('still opens the modal for an installed pick when an update is available', async () => {
$agentPlugins.set([
{
catalog_name: 'demo-weather',
@@ -497,17 +438,19 @@ describe('PluginsTab catalog UX', () => {
}
])
- const entry = { ...weatherEntry, name: 'demo-weather', sha: 'b'.repeat(40) }
- seedCatalog([entry])
- await act(async () => { renderPlugins({ profile: null }) })
- await selectCatalogEntry(entry.name)
- fireEvent.click(screen.getByRole('button', { name: 'Install' }))
-
- expect($pluginInstallRequest.get()).toMatchObject({
- catalogName: entry.name,
- repo: entry.repo,
- profile: null,
- sha: entry.sha
- })
+ render(<PluginsTab profile={null} />)
+
+ window.dispatchEvent(
+ new MessageEvent('message', {
+ data: {
+ name: 'demo-weather',
+ repo: 'https://github.com/example/demo-weather',
+ type: 'hermes-plugin-pick'
+ },
+ origin: 'https://hermes-agent.nousresearch.com'
+ })
+ )
+
+ await waitFor(() => expect($pluginInstallRequest.get()).not.toBeNull())
})
})
diff --git a/apps/desktop/src/app/skills/plugins-tab.tsx b/apps/desktop/src/app/skills/plugins-tab.tsx
index 4427b15d6e6..9c8c1e5e5c9 100644
--- a/apps/desktop/src/app/skills/plugins-tab.tsx
+++ b/apps/desktop/src/app/skills/plugins-tab.tsx
@@ -1,5 +1,13 @@
import { useStore } from '@nanostores/react'
-import { memo, type ReactNode, useEffect, useMemo } from 'react'
+import {
+ memo,
+ type ReactNode,
+ type PointerEvent as ReactPointerEvent,
+ useEffect,
+ useMemo,
+ useRef,
+ useState
+} from 'react'
import { useGatewayRequest } from '@/app/gateway/hooks/use-gateway-request'
import { Button } from '@/components/ui/button'
@@ -16,6 +24,8 @@ import { cn } from '@/lib/utils'
import {
$agentPluginBusy,
$agentPlugins,
+ $agentPluginsError,
+ $agentPluginsStatus,
type AgentPluginRow,
type GatewayRequest,
isDesktopRelevantPlugin,
@@ -24,17 +34,47 @@ import {
updateAgentPlugin
} from '@/store/agent-plugins'
import { notify, notifyError } from '@/store/notifications'
+import { $paneHeightOverride, setPaneHeightOverride } from '@/store/panes'
import { openPluginInstallRequest } from '@/store/plugin-install-request'
import { $connection } from '@/store/session'
+import { PanelEmpty } from '../overlays/panel'
import { Pill } from '../settings/primitives'
import { useDeepLinkHighlight } from '../settings/use-deep-link-highlight'
-import type { CapabilityView } from './capability-tabs'
-import { CatalogBrowser } from './catalog-browser'
-import { type CatalogEntry, parseCatalog } from './catalog-data'
import { mergePluginPackages, type PackageKind, type PluginPackage } from './plugin-packages'
+// The REAL Plugin Catalog page (docs site) embedded as a one-click picker —
+// the same pattern as the Skills tab's EmbeddedHubPicker. `?embed=picker`
+// hides the docs chrome and adds "+ Add to this Agent" per card, which posts
+// { type: 'hermes-plugin-pick', name, repo, sha, subdir, tier, installCmd }
+// to the parent window. We validate the origin and open the shared
+// dual-target install modal (agent half → catalog-pinned install into the
+// scoped profile; desktop half → this app), so unified packages install both
+// halves in one flow.
+const CATALOG_ORIGIN = 'https://hermes-agent.nousresearch.com'
+const CATALOG_PICKER_URL = `${CATALOG_ORIGIN}/docs/plugins?embed=picker`
+
+// Catalog viewport: persisted through the shared pane store, dragged from the
+// section's TOP edge ("pull the catalog up"), clamped so neither the catalog
+// nor the plugin list above can vanish. Same contract as EmbeddedHubPicker.
+const CATALOG_PANE_ID = 'capabilities-plugin-catalog'
+const CATALOG_DEFAULT_PX = 380
+const CATALOG_MIN_PX = 120
+const CATALOG_MAX_VH = 0.75
+const CATALOG_COLLAPSED_PX = 4
+const CATALOG_LIST_RESERVED_PX = 176
+
+interface PluginPickMessage {
+ installCmd?: string
+ name?: string
+ repo?: string
+ sha?: string
+ subdir?: string
+ tier?: string
+ type?: string
+}
+
/** Deep-link anchor for a package row (`/skills?tab=plugins&plugin=<key>`).
* Accepts the agent key, the agent name, or the desktop record id. */
export const pluginElementId = (target: string) => `plugin-${target}`
@@ -153,11 +193,15 @@ function ProvenancePill({ pkg }: { pkg: PluginPackage }) {
return null
}
-/** Controls for one installed plugin half in the detail pane. */
+/** Column widths shared by the header and every row so the two control
+ * columns line up down the page like a table. */
+const HALF_COL = 'flex w-36 shrink-0 items-center gap-1.5'
+
+/** One control cell; `label` is the accessible name for screen readers only
+ * (the visible column label lives once, in the header). */
function HalfCell({ label, children }: { label: string; children: ReactNode }) {
return (
- <div aria-label={label} className="flex w-full items-center gap-3" role="cell">
- <span className="min-w-0 flex-1 text-xs text-(--ui-text-tertiary)">{label}</span>
+ <div aria-label={label} className={HALF_COL} role="cell">
{children}
</div>
)
@@ -200,12 +244,12 @@ function PackageRow({
return (
<div
- className="flex flex-col gap-5"
+ className="flex items-center gap-3 border-b border-(--ui-stroke-tertiary) px-3 py-2.5 last:border-b-0"
data-testid={`plugin-row-${pkg.key}`}
id={pluginElementId(agent?.key ?? agent?.name ?? desktop?.id ?? pkg.key)}
role="row"
>
- <div className="flex w-full min-w-0 flex-1 items-start gap-2" role="cell">
+ <div className="flex min-w-0 flex-1 items-start gap-2" role="cell">
<div className="min-w-0 flex-1">
<div className="flex flex-wrap items-center gap-2 text-[length:var(--conversation-text-font-size)] font-medium text-foreground">
<span>{pkg.name}</span>
@@ -316,49 +360,31 @@ function PackageRow({
)
}
-export function PluginActions({ profile }: { profile: ProfileScope }) {
- const { t } = useI18n()
- const d = t.settings.plugins
- const { requestGateway } = useGatewayRequest()
- const scope = profileParam(profile)
-
- return <>
- <Button className="underline" onClick={() => openPluginInstallRequest({ profile: scope, repo: '' })} size="xs" variant="text">
- {d.installModal.installFromGit}
- </Button>
- <Tip label={d.openFolder}>
- <Button aria-label={d.openFolder} onClick={() => void revealPluginsDir()} size="icon-xs" variant="ghost"><FolderOpen /></Button>
- </Tip>
- <Tip label={d.rescan}>
- <Button aria-label={d.rescan} onClick={() => void rescanAll(requestGateway, scope)} size="icon-xs" variant="ghost"><RefreshCw /></Button>
- </Tip>
- </>
-}
-
/** THE plugins surface: one row per package. Each row shows its Desktop half
* (this app — the same for every profile, gateway, or machine) and its Agent
- * half (the selected profile's backend). Browse uses the shared native
- * catalog; Install from Git remains available for unlisted packages. */
+ * half (the selected profile's backend). Discovery sits underneath: the live
+ * catalog picker plus Install from Git for anything not in the catalog. */
export const PluginsTab = memo(function PluginsTab({
profile,
- scopeLabel,
- view = 'installed',
- query = '',
- onQueryChange
+ scopeSelector,
+ scopeLabel
}: {
- query?: string
- onQueryChange?: (value: string) => void
- view?: CapabilityView
profile: ProfileScope
+ /** The Capabilities profile selector; rendered in the Agent column header so
+ * it visibly governs only that column. */
+ scopeSelector?: ReactNode
/** Display name of the selected profile for the Agent column label. */
scopeLabel?: string
}) {
const { t } = useI18n()
const p = t.skills.plugins
+ const d = t.settings.plugins
const { requestGateway } = useGatewayRequest()
const desktopRecords = useStore($pluginRecords)
const agentRows = useStore($agentPlugins)
+ const status = useStore($agentPluginsStatus)
+ const error = useStore($agentPluginsError)
const busyKey = useStore($agentPluginBusy)
const scope = profileParam(profile)
@@ -375,67 +401,255 @@ export const PluginsTab = memo(function PluginsTab({
useDeepLinkHighlight({ param: 'plugin', ready: () => true, elementId: pluginElementId })
+ // Catalog picker viewport (persisted height, collapse toggle, top-edge sash).
+ const heightOverride = useStore($paneHeightOverride(CATALOG_PANE_ID))
+ const height = heightOverride ?? CATALOG_DEFAULT_PX
+ const open = height > CATALOG_COLLAPSED_PX
+ const [pickerMounted, setPickerMounted] = useState(open)
+ const [dragging, setDragging] = useState(false)
+ const sectionRef = useRef<HTMLElement>(null)
+
+ if (open && !pickerMounted) {
+ setPickerMounted(true)
+ }
+
+ const startDrag = (event: ReactPointerEvent<HTMLDivElement>) => {
+ if (event.button !== 0) {
+ return
+ }
+
+ event.preventDefault()
+ const startY = event.clientY
+ const startHeight = height
+ const column = sectionRef.current?.parentElement
+ const columnMax = column ? column.clientHeight - CATALOG_LIST_RESERVED_PX : Number.POSITIVE_INFINITY
+ const max = Math.max(CATALOG_MIN_PX, Math.round(Math.min(window.innerHeight * CATALOG_MAX_VH, columnMax)))
+ setDragging(true)
+
+ const onMove = (move: globalThis.PointerEvent) => {
+ setPaneHeightOverride(
+ CATALOG_PANE_ID,
+ Math.round(Math.min(max, Math.max(CATALOG_MIN_PX, startHeight + (startY - move.clientY))))
+ )
+ }
+
+ const onUp = () => {
+ window.removeEventListener('pointermove', onMove)
+ setDragging(false)
+ }
+
+ window.addEventListener('pointermove', onMove)
+ window.addEventListener('pointerup', onUp, { once: true })
+ }
+
+ useEffect(() => {
+ if (!open) {
+ return undefined
+ }
+
+ const onMessage = (event: MessageEvent) => {
+ if (event.origin !== CATALOG_ORIGIN) {
+ return
+ }
+
+ const data = event.data as null | PluginPickMessage
+
+ if (!data || data.type !== 'hermes-plugin-pick' || !data.name || !data.repo) {
+ return
+ }
+
+ const existing = $agentPlugins.get().find(row => row.catalog_name === data.name || row.name === data.name)
+
+ if (existing && !existing.update_available) {
+ notify({ kind: 'success', message: p.alreadyInstalled(String(data.name)) })
+
+ return
+ }
+
+ openPluginInstallRequest({
+ catalogName: String(data.name),
+ profile: scope,
+ repo: data.subdir ? `${String(data.repo)}#${String(data.subdir)}` : String(data.repo),
+ sha: data.sha ? String(data.sha) : undefined
+ })
+ }
+
+ window.addEventListener('message', onMessage)
+
+ return () => window.removeEventListener('message', onMessage)
+ }, [open, p, scope])
+
const agentBusy = (row: AgentPluginRow) => busyKey === (row.key ?? row.name) || busyKey === row.name
- const installedEntries = useMemo(() => parseCatalog('plugins', packages.map(pkg => ({
- name: pkg.name,
- identifier: pkg.agent?.catalog_name ?? pkg.desktop?.packageOrigin?.catalogName ?? pkg.key,
- description: pkg.description,
- category: pkg.kind === 'desktop' ? 'desktop' : 'general',
- tier: pkg.agent?.catalog_tier ?? pkg.agent?.source ?? pkg.desktop?.kind ?? '',
- repo: pkg.desktop?.packageOrigin?.repo ?? '',
- sha: pkg.agent?.installed_sha ?? pkg.desktop?.packageOrigin?.sha ?? '',
- version: pkg.agent?.version ?? ''
- }))).map((entry, index) => ({ ...entry, id: `installed:${packages[index].key}` })), [packages])
- const packageById = useMemo(() => new Map(packages.map(pkg => [`installed:${pkg.key}`, pkg])), [packages])
- const isInstalled = (entry: CatalogEntry) => packageById.has(entry.id) || agentRows.some(row =>
- (row.catalog_name === entry.name || row.name === entry.name) && !row.update_available
- )
- const install = (entry: CatalogEntry) => openPluginInstallRequest({
- catalogName: entry.name,
- profile: scope,
- repo: entry.subdir ? `${entry.repo}#${entry.subdir}` : entry.repo,
- sha: entry.sha
- })
return (
<div className="flex h-full min-h-0 flex-col">
- <CatalogBrowser
- installedEntries={installedEntries}
- isInstalled={isInstalled}
- kind="plugins"
- onInstall={install}
- onQueryChange={onQueryChange}
- query={query}
- renderInstalledDetail={entry => {
- const pkg = packageById.get(entry.id)
-
- if (!pkg) {
- return null
- }
-
- return <PackageRow
- busy={pkg.agent ? agentBusy(pkg.agent) : false}
- key={pkg.key}
- onAgentToggle={(row, enable) => {
- if (row.key) {
- void toggleAgentPlugin(requestGateway, row.key, enable, p.toggleFailed(row.name), scope)
- }
- }}
- onAgentUpdate={row => {
- void updateAgentPlugin(requestGateway, row.name, p.updateFailed(row.name), scope).then(applied => {
- if (applied) {
- notify({ kind: 'success', message: p.updated(row.name) })
+ <div className="min-h-32 flex-1 overflow-y-auto">
+ {/* Header: what the two columns mean, and the controls that act on
+ the whole page (install, folder, rescan). */}
+ <div className="flex flex-wrap items-start justify-between gap-3 px-3 pt-3 pb-2">
+ <p className="min-w-0 flex-1 text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
+ {p.pageBlurb}
+ </p>
+ <div className="flex shrink-0 items-center gap-1">
+ <Button
+ onClick={() => openPluginInstallRequest({ profile: scope, repo: '' })}
+ size="sm"
+ type="button"
+ variant="secondary"
+ >
+ {d.installModal.installFromGit}
+ </Button>
+ <Tip label={d.openFolder}>
+ <Button
+ aria-label={d.openFolder}
+ onClick={() => void revealPluginsDir()}
+ size="icon"
+ type="button"
+ variant="ghost"
+ >
+ <FolderOpen className="size-3.5" />
+ </Button>
+ </Tip>
+ <Tip label={d.rescan}>
+ <Button
+ aria-label={d.rescan}
+ onClick={() => {
+ triggerHaptic('selection')
void rescanAll(requestGateway, scope)
- }
- })
- }}
- pkg={pkg}
- scope={scope}
- scopeLabel={label}
+ }}
+ size="icon"
+ type="button"
+ variant="ghost"
+ >
+ <RefreshCw className="size-3.5" />
+ </Button>
+ </Tip>
+ </div>
+ </div>
+
+ {status === 'error' ? (
+ <PanelEmpty
+ action={
+ <Button onClick={() => void loadAgentPlugins(requestGateway, scope)} size="sm">
+ {t.skills.refresh}
+ </Button>
+ }
+ description={error ?? undefined}
+ icon="error"
+ title={p.loadFailed}
/>
- }}
- view={view}
- />
+ ) : packages.length === 0 && status === 'ready' ? (
+ <p className="px-3 py-3 text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
+ {p.emptyAll} {p.emptyHint}
+ </p>
+ ) : (
+ <div className="flex flex-col" role="table">
+ {/* Column header: the visible labels for the two control columns,
+ aligned with the cells below. The profile selector sits INSIDE
+ the Agent header so it visibly governs only that column. */}
+ <div
+ className="flex items-center gap-3 border-y border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) px-3 py-1.5 text-[0.68rem] text-(--ui-text-tertiary)"
+ role="row"
+ >
+ <div className="min-w-0 flex-1" role="columnheader" />
+ <div className={HALF_COL} role="columnheader">
+ <Monitor aria-hidden className="size-3.5 shrink-0" />
+ <Tip label={p.halfDesktopHint}>
+ <span className="font-medium">{p.halfDesktop}</span>
+ </Tip>
+ </div>
+ <div className={HALF_COL} role="columnheader">
+ <Package aria-hidden className="size-3.5 shrink-0" />
+ {scopeSelector ?? <span className="truncate font-medium">{p.halfAgentIn(label)}</span>}
+ </div>
+ </div>
+ {packages.map(pkg => (
+ <PackageRow
+ busy={pkg.agent ? agentBusy(pkg.agent) : false}
+ key={pkg.key}
+ onAgentToggle={(row, enable) => {
+ if (!row.key) {
+ return
+ }
+
+ void toggleAgentPlugin(requestGateway, row.key, enable, p.toggleFailed(row.name), scope)
+ }}
+ onAgentUpdate={row => {
+ void updateAgentPlugin(requestGateway, row.name, p.updateFailed(row.name), scope).then(applied => {
+ if (applied) {
+ notify({ kind: 'success', message: p.updated(row.name) })
+ void rescanAll(requestGateway, scope)
+ }
+ })
+ }}
+ pkg={pkg}
+ scope={scope}
+ scopeLabel={label}
+ />
+ ))}
+ </div>
+ )}
+ </div>
+
+ <section
+ className="relative flex min-h-9 flex-col overflow-hidden border-t border-(--ui-stroke-secondary)"
+ ref={sectionRef}
+ >
+ <div
+ className="group/catsash absolute inset-x-0 top-0 z-10 h-1 -translate-y-1/2 cursor-row-resize"
+ data-testid="plugin-catalog-sash"
+ onDoubleClick={() => setPaneHeightOverride(CATALOG_PANE_ID, undefined)}
+ onPointerDown={startDrag}
+ >
+ <div
+ className={cn(
+ 'absolute inset-x-0 top-1/2 h-px -translate-y-1/2 transition-colors',
+ dragging ? 'bg-(--ui-stroke-secondary)' : 'group-hover/catsash:bg-(--ui-stroke-secondary)'
+ )}
+ />
+ </div>
+ <div className="flex shrink-0 items-center justify-between px-3 py-1.5">
+ <span className="text-[0.62rem] font-medium tracking-wide uppercase text-(--ui-text-quaternary)">
+ {p.catalogTitle}
+ </span>
+ <Button onClick={() => setPaneHeightOverride(CATALOG_PANE_ID, open ? 0 : undefined)} size="xs" variant="text">
+ {open ? p.catalogHide : p.catalogBrowse}
+ </Button>
+ </div>
+ {pickerMounted && (
+ <div className={cn('flex min-h-0 flex-col gap-1 px-3 pb-2', !open && 'hidden')}>
+ <div
+ style={{
+ border: '1px solid var(--ui-stroke-secondary)',
+ borderRadius: 8,
+ flex: `0 1 ${height}px`,
+ maxWidth: '100%',
+ minHeight: 0,
+ minWidth: 320,
+ overflow: 'hidden',
+ position: 'relative',
+ width: '100%'
+ }}
+ >
+ <iframe
+ sandbox="allow-scripts allow-same-origin"
+ src={CATALOG_PICKER_URL}
+ style={{
+ background: 'transparent',
+ border: 'none',
+ height: '133.34%',
+ pointerEvents: dragging ? 'none' : 'auto',
+ transform: 'scale(0.75)',
+ transformOrigin: 'top left',
+ width: '133.34%'
+ }}
+ title={p.catalogTitle}
+ />
+ </div>
+ <p className="shrink-0 px-1 text-[0.65rem] leading-4 text-(--ui-text-quaternary)">{p.catalogHint}</p>
+ </div>
+ )}
+ </section>
</div>
)
})
diff --git a/apps/desktop/src/app/skills/skill-catalog.tsx b/apps/desktop/src/app/skills/skill-catalog.tsx
deleted file mode 100644
index 61bc62636f1..00000000000
--- a/apps/desktop/src/app/skills/skill-catalog.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { useCallback, useState } from 'react'
-
-import type { ProfileScope } from '@/hermes'
-import { useI18n } from '@/i18n'
-import { installHubSkill, notifyHubActionFailed } from '@/store/hub-actions'
-import { notify } from '@/store/notifications'
-
-import { CatalogBrowser } from './catalog-browser'
-import type { CatalogEntry } from './catalog-data'
-
-interface SkillCatalogProps {
- installedNames: ReadonlySet<string>
- profile?: ProfileScope
- query?: string
- onQueryChange?: (value: string) => void
-}
-
-export function SkillCatalog({ installedNames, profile, query = '', onQueryChange }: SkillCatalogProps) {
- const { t } = useI18n()
- const h = t.skills.hub
- const [installing, setInstalling] = useState<ReadonlySet<string>>(new Set())
- const isInstalled = useCallback((entry: CatalogEntry) => installedNames.has(entry.name) || installedNames.has(entry.identifier), [installedNames])
-
- const install = (entry: CatalogEntry) => {
- if (!entry.installIdentifier || isInstalled(entry) || installing.has(entry.id)) {
- return
- }
-
- setInstalling(current => new Set(current).add(entry.id))
- notify({ kind: 'success', title: h.installStarted(entry.name), message: h.actionLog })
- void installHubSkill(entry.installIdentifier, profile)
- .catch(err => notifyHubActionFailed(err, h.actionFailed, entry.name, profile))
- .finally(() => setInstalling(current => new Set([...current].filter(id => id !== entry.id))))
- }
-
- return (
- <CatalogBrowser
- isInstalled={isInstalled}
- isInstalling={entry => installing.has(entry.id)}
- kind="skills"
- onInstall={install}
- onQueryChange={onQueryChange}
- query={query}
- />
- )
-}
diff --git a/apps/desktop/src/app/skills/update-skills-button.tsx b/apps/desktop/src/app/skills/update-skills-button.tsx
deleted file mode 100644
index 56fa026c028..00000000000
--- a/apps/desktop/src/app/skills/update-skills-button.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Button } from '@/components/ui/button'
-import type { ProfileScope } from '@/hermes'
-import { useI18n } from '@/i18n'
-import { useStoreSelector } from '@/lib/use-session-slice'
-import { $hubActions, UPDATE_ALL_KEY, updateHubSkills } from '@/store/hub-actions'
-import { notify, notifyError } from '@/store/notifications'
-
-export function UpdateSkillsButton({ profile }: { profile?: ProfileScope }) {
- const { t } = useI18n()
- const h = t.skills.hub
- const updating = useStoreSelector($hubActions, actions => actions[UPDATE_ALL_KEY]?.running ?? false)
-
- return (
- <Button disabled={updating} onClick={() => {
- notify({ kind: 'success', title: h.updateStarted, message: h.actionLog })
- void updateHubSkills(profile).catch(err => notifyError(err, h.actionFailed))
- }} size="xs" variant="text">
- {updating ? h.updating : h.updateAll}
- </Button>
- )
-}
diff --git a/apps/desktop/src/components/confirm-host.test.tsx b/apps/desktop/src/components/confirm-host.test.tsx
index 7ae5ff312f7..0aeff59273e 100644
--- a/apps/desktop/src/components/confirm-host.test.tsx
+++ b/apps/desktop/src/components/confirm-host.test.tsx
@@ -64,42 +64,6 @@ 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.tsx
index 02446f70d04..2b6f8752b97 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, runConfirm, settleConfirm } from '@/store/confirm'
+import { $confirmRequest, type PendingConfirm, settleConfirm } from '@/store/confirm'
// The one mount point for `confirm()` from @/store/confirm. Mounted once at the
// shell, the way NotificationStack backs notify().
@@ -24,29 +24,17 @@ export function ConfirmHost() {
return (
<ConfirmDialog
- busyLabel={shown.busyLabel}
cancelLabel={shown.cancelLabel}
confirmLabel={shown.confirmLabel}
description={shown.description}
destructive={shown.destructive}
- dismissOnConfirm={!shown.onConfirm}
- doneLabel={shown.doneLabel}
- key={shown.id}
- onClose={() => settleConfirm(shown.phase === 'done', shown)}
- onConfirm={() => runConfirm(shown)}
+ // 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)}
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.tsx
index 37f5a904617..fc166efd439 100644
--- a/apps/desktop/src/components/ui/confirm-dialog.tsx
+++ b/apps/desktop/src/components/ui/confirm-dialog.tsx
@@ -21,7 +21,6 @@ interface ConfirmDialogProps {
onConfirm: () => Promise<void> | void
title: ReactNode
description?: ReactNode
- children?: ReactNode
confirmLabel?: string
busyLabel?: string
doneLabel?: string
@@ -49,7 +48,6 @@ export function ConfirmDialog({
onConfirm,
title,
description,
- children,
confirmLabel,
busyLabel,
doneLabel,
@@ -155,7 +153,6 @@ 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.ts b/apps/desktop/src/i18n/ar.ts
index e28a483653e..bb826de0c80 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -1,43 +1,6 @@
import { defineLocale } from './define-locale'
export const ar = defineLocale({
- catalog: {
- installTitle: (name: string) => `تثبيت «${name}»؟`,
- installDescription: 'ستتوفر هذه المهارة في الجلسات الجديدة. ثبّت من المصادر التي تثق بها فقط.',
- installTo: 'التثبيت في',
- thisComputer: 'هذا الكمبيوتر',
- installing: 'جارٍ التثبيت…',
- installComplete: (name: string) => `تم تثبيت «${name}»`,
- destinationChanged: 'تغيرت وجهة التثبيت. أغلق هذا الحوار وافتح رابط التثبيت مجددًا.',
- browse: 'تصفح',
- installed: 'المثبتة',
- searchSkills: 'البحث في المهارات',
- searchPlugins: 'البحث في الإضافات',
- allSources: 'كل المصادر',
- allCategories: 'كل الفئات',
- about: 'نبذة',
- author: 'المؤلف',
- source: 'المصدر',
- category: 'الفئة',
- version: 'الإصدار',
- platforms: 'المنصات',
- requires: 'المتطلبات',
- tools: 'الأدوات',
- hooks: 'الخطافات',
- repository: 'المستودع',
- documentation: 'التوثيق',
- noResults: 'لا توجد نتائج مطابقة',
- tryAnother: 'جرّب بحثًا آخر أو امسح عوامل التصفية.',
- clearFilters: 'مسح عوامل التصفية',
- loadFailed: 'تعذر تحميل الكتالوج',
- retry: 'حاول مرة أخرى',
- more: 'عرض المزيد',
- pinned: 'التزام تمت مراجعته',
- snapshotHint: 'من كتالوج Hermes. لا يتصل التصفح بمستودعات المصدر مطلقًا.',
- installHint: 'راجع المصدر قبل التثبيت. تسري التغييرات على الجلسات الجديدة.',
- results: (count: number) => `النتائج: ${count.toLocaleString('ar')}`,
- back: 'العودة إلى النتائج'
- },
sessionImport: {
title: 'المتابعة من تطبيق آخر',
subtitle: 'انقل محادثة إلى Hermes وتابع من حيث توقفت.',
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 3ae0ee3ed16..2b9922704c3 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -3,43 +3,6 @@ import { FIELD_DESCRIPTIONS, FIELD_LABELS } from '@/app/settings/constants'
import type { Translations } from './types'
export const en: Translations = {
- catalog: {
- 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.',
- browse: 'Browse',
- installed: 'Installed',
- searchSkills: 'Search skills',
- searchPlugins: 'Search plugins',
- allSources: 'All sources',
- allCategories: 'All categories',
- about: 'About',
- author: 'Author',
- source: 'Source',
- category: 'Category',
- version: 'Version',
- platforms: 'Platforms',
- requires: 'Requires',
- tools: 'Tools',
- hooks: 'Hooks',
- repository: 'Repository',
- documentation: 'Documentation',
- noResults: 'No matches',
- tryAnother: 'Try another search or clear your filters.',
- clearFilters: 'Clear filters',
- loadFailed: 'Could not load the catalog',
- retry: 'Try again',
- more: 'Show more',
- pinned: 'Reviewed commit',
- snapshotHint: 'From the Hermes catalog. Browsing never contacts source repositories.',
- installHint: 'Review the source before installing. Changes apply to new sessions.',
- results: (count: number) => `${count.toLocaleString()} result${count === 1 ? '' : 's'}`,
- back: 'Back to results'
- },
connectors: {
title: 'Connect your apps',
connect: 'Connect',
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index 7ffbe388e51..8f34f3d4ea2 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -3,43 +3,6 @@ import { defineFieldCopy } from '@/app/settings/field-copy'
import { defineLocale } from './define-locale'
export const ja = defineLocale({
- catalog: {
- installTitle: (name: string) => `「${name}」をインストールしますか?`,
- installDescription: 'このスキルは新しいセッションで利用できます。信頼できる提供元からのみインストールしてください。',
- installTo: 'インストール先',
- thisComputer: 'このコンピューター',
- installing: 'インストール中…',
- installComplete: (name: string) => `「${name}」をインストールしました`,
- destinationChanged: 'インストール先が変更されました。このダイアログを閉じ、インストールリンクを開き直してください。',
- browse: '閲覧',
- installed: 'インストール済み',
- searchSkills: 'スキルを検索',
- searchPlugins: 'プラグインを検索',
- allSources: 'すべての提供元',
- allCategories: 'すべてのカテゴリ',
- about: '概要',
- author: '作者',
- source: '提供元',
- category: 'カテゴリ',
- version: 'バージョン',
- platforms: '対応プラットフォーム',
- requires: '必要なもの',
- tools: 'ツール',
- hooks: 'フック',
- repository: 'リポジトリ',
- documentation: 'ドキュメント',
- noResults: '一致する項目がありません',
- tryAnother: '別の検索を試すか、フィルターをクリアしてください。',
- clearFilters: 'フィルターをクリア',
- loadFailed: 'カタログを読み込めませんでした',
- retry: '再試行',
- more: 'さらに表示',
- pinned: 'レビュー済みコミット',
- snapshotHint: 'Hermesカタログの情報です。閲覧時に提供元のリポジトリへ接続することはありません。',
- installHint: 'インストール前にソースを確認してください。変更は新しいセッションに適用されます。',
- results: (count: number) => `${count.toLocaleString('ja')}件の結果`,
- back: '結果に戻る'
- },
sessionImport: {
title: '別のアプリから続ける',
subtitle: '会話をHermesに取り込み、続きを始めましょう。',
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index ee2af97cc25..7fbf02e189b 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -24,44 +24,6 @@ const RU_NOUN = (count: number | string, one: string, few: string, many: string)
}
export const ru = defineLocale({
- catalog: {
- installTitle: (name: string) => `Установить «${name}»?`,
- installDescription: 'Навык будет доступен в новых сессиях. Устанавливайте только из источников, которым доверяете.',
- installTo: 'Установить в',
- thisComputer: 'Этот компьютер',
- installing: 'Установка…',
- installComplete: (name: string) => `«${name}» установлен`,
- destinationChanged: 'Место установки изменилось. Закройте диалог и снова откройте ссылку установки.',
- browse: 'Обзор',
- installed: 'Установленные',
- searchSkills: 'Поиск навыков',
- searchPlugins: 'Поиск плагинов',
- allSources: 'Все источники',
- allCategories: 'Все категории',
- about: 'Описание',
- author: 'Автор',
- source: 'Источник',
- category: 'Категория',
- version: 'Версия',
- platforms: 'Платформы',
- requires: 'Требования',
- tools: 'Инструменты',
- hooks: 'Хуки',
- repository: 'Репозиторий',
- documentation: 'Документация',
- noResults: 'Совпадений нет',
- tryAnother: 'Попробуйте другой запрос или сбросьте фильтры.',
- clearFilters: 'Сбросить фильтры',
- loadFailed: 'Не удалось загрузить каталог',
- retry: 'Попробовать снова',
- more: 'Показать ещё',
- pinned: 'Проверенный коммит',
- snapshotHint: 'Из каталога Hermes. При просмотре нет обращений к исходным репозиториям.',
- installHint: 'Проверьте исходный код перед установкой. Изменения применяются к новым сессиям.',
- results: (count: number) =>
- `${count.toLocaleString('ru')} ${RU_PLURAL(count, 'результат', 'результата', 'результатов')}`,
- back: 'Назад к результатам'
- },
sessionImport: {
title: 'Продолжить из другого приложения',
subtitle: 'Перенесите разговор в Hermes и продолжите с того места, где остановились.',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index c5f0ad2eba0..5ef1f54d12d 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -59,43 +59,6 @@ interface AuxTaskCopy {
}
export interface Translations {
- catalog: {
- installTitle: (name: string) => string
- installDescription: string
- installTo: string
- thisComputer: string
- installing: string
- installComplete: (name: string) => string
- destinationChanged: string
- browse: string
- installed: string
- searchSkills: string
- searchPlugins: string
- allSources: string
- allCategories: string
- about: string
- author: string
- source: string
- category: string
- version: string
- platforms: string
- requires: string
- tools: string
- hooks: string
- repository: string
- documentation: string
- noResults: string
- tryAnother: string
- clearFilters: string
- loadFailed: string
- retry: string
- more: string
- pinned: string
- snapshotHint: string
- installHint: string
- results: (count: number) => string
- back: string
- }
connectors: {
title: string
connect: string
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index 86bf26e2ac2..7d007222d5c 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -3,43 +3,6 @@ import { defineFieldCopy } from '@/app/settings/field-copy'
import { defineLocale } from './define-locale'
export const zhHant = defineLocale({
- catalog: {
- installTitle: (name: string) => `安裝「${name}」?`,
- installDescription: '此技能將於新的工作階段中可用。請僅安裝可信來源的內容。',
- installTo: '安裝至',
- thisComputer: '這部電腦',
- installing: '正在安裝…',
- installComplete: (name: string) => `已安裝「${name}」`,
- destinationChanged: '安裝目標已變更。請關閉此對話框並重新開啟安裝連結。',
- browse: '瀏覽',
- installed: '已安裝',
- searchSkills: '搜尋技能',
- searchPlugins: '搜尋外掛',
- allSources: '所有來源',
- allCategories: '所有分類',
- about: '簡介',
- author: '作者',
- source: '來源',
- category: '分類',
- version: '版本',
- platforms: '支援的平台',
- requires: '相依項目',
- tools: '工具',
- hooks: '掛鉤',
- repository: '程式碼儲存庫',
- documentation: '文件',
- noResults: '沒有符合的項目',
- tryAnother: '請嘗試其他搜尋或清除篩選條件。',
- clearFilters: '清除篩選條件',
- loadFailed: '無法載入目錄',
- retry: '再試一次',
- more: '顯示更多',
- pinned: '已審核的提交',
- snapshotHint: '內容來自 Hermes 目錄。瀏覽時不會連線至來源程式碼儲存庫。',
- installHint: '安裝前請檢查原始碼。變更將於新的工作階段生效。',
- results: (count: number) => `${count.toLocaleString('zh-Hant')} 個結果`,
- back: '返回結果'
- },
sessionImport: {
title: '從其他應用程式繼續',
subtitle: '將對話匯入 Hermes,接著上次的進度繼續。',
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 3cfd6b0f728..76c33367243 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -3,43 +3,6 @@ import { defineFieldCopy } from '@/app/settings/field-copy'
import { defineLocale } from './define-locale'
export const zh = defineLocale({
- catalog: {
- installTitle: (name: string) => `安装“${name}”?`,
- installDescription: '此技能将在新会话中可用。请仅安装可信来源的内容。',
- installTo: '安装到',
- thisComputer: '此电脑',
- installing: '正在安装…',
- installComplete: (name: string) => `已安装“${name}”`,
- destinationChanged: '安装目标已更改。请关闭此对话框并重新打开安装链接。',
- browse: '浏览',
- installed: '已安装',
- searchSkills: '搜索技能',
- searchPlugins: '搜索插件',
- allSources: '所有来源',
- allCategories: '所有分类',
- about: '简介',
- author: '作者',
- source: '来源',
- category: '分类',
- version: '版本',
- platforms: '支持的平台',
- requires: '依赖项',
- tools: '工具',
- hooks: '钩子',
- repository: '代码仓库',
- documentation: '文档',
- noResults: '没有匹配项',
- tryAnother: '请尝试其他搜索或清除筛选条件。',
- clearFilters: '清除筛选条件',
- loadFailed: '无法加载目录',
- retry: '重试',
- more: '显示更多',
- pinned: '已审核的提交',
- snapshotHint: '内容来自 Hermes 目录。浏览时不会连接来源代码仓库。',
- installHint: '安装前请检查源代码。更改将在新会话中生效。',
- results: (count: number) => `${count.toLocaleString('zh')} 个结果`,
- back: '返回结果'
- },
connectors: {
title: '连接你的应用',
connect: '连接',
diff --git a/apps/desktop/src/lib/catalog-install.test.ts b/apps/desktop/src/lib/catalog-install.test.ts
deleted file mode 100644
index 62b3b76f002..00000000000
--- a/apps/desktop/src/lib/catalog-install.test.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { pluginCatalogInstallUrl, skillCatalogInstallIdentifier, skillCatalogInstallUrl } from '@hermes/shared'
-import { describe, expect, it } from 'vitest'
-
-import { resolveDeepLinkAction } from './deeplink-routes'
-
-function route(href: string) {
- const url = new URL(href)
-
- return resolveDeepLinkAction({ kind: url.hostname, name: url.pathname.slice(1), params: Object.fromEntries(url.searchParams) })
-}
-
-describe('public catalog install links', () => {
- it.each([
- [{ name: 'Apple Design', source: 'ClawHub', identifier: 'apple-design' }, 'clawhub/apple-design'],
- [{ name: 'Apple Design', source: 'ClawHub', identifier: 'clawhub/apple-design' }, 'clawhub/apple-design'],
- [{ name: 'pdf', source: 'Anthropic', identifier: 'anthropics/skills/skills/pdf' }, 'anthropics/skills/skills/pdf'],
- [{ name: 'pdf', source: 'optional' }, 'official/pdf'],
- [{ name: 'pdf', source: 'built-in', installIdentifier: 'NousResearch/hermes-agent/skills/productivity/pdf' }, 'NousResearch/hermes-agent/skills/productivity/pdf'],
- [{ name: 'A name', source: 'future-source', identifier: 'provider/path?mode=one&two#readme' }, 'provider/path?mode=one&two#readme']
- ])('preserves the source-specific target for %o', (entry, identifier) => {
- expect(skillCatalogInstallIdentifier(entry)).toBe(identifier)
- expect(route(skillCatalogInstallUrl(entry)!)).toEqual({ type: 'skill-install', identifier })
- })
-
- it('omits bundled install links when an older snapshot has no exact target', () => {
- expect(skillCatalogInstallUrl({ name: 'pdf', source: 'built-in' })).toBeNull()
- })
-
- it('forwards catalog identity, display pin and encoded subdirectory to the plugin confirmation', () => {
- const plugin = { name: 'weather', repo: 'https://github.com/owner/plugins', subdir: 'packages/weather', sha: 'a'.repeat(40) }
-
- expect(route(pluginCatalogInstallUrl(plugin))).toEqual({
- type: 'plugin-install', repo: `${plugin.repo}#${plugin.subdir}`, catalogName: plugin.name,
- sha: plugin.sha, enable: true, force: false, legacyHint: null
- })
- })
-})
diff --git a/apps/desktop/src/lib/deeplink-routes.test.ts b/apps/desktop/src/lib/deeplink-routes.test.ts
index d5350303f6b..76683577afc 100644
--- a/apps/desktop/src/lib/deeplink-routes.test.ts
+++ b/apps/desktop/src/lib/deeplink-routes.test.ts
@@ -19,30 +19,6 @@ describe('resolveDeepLinkAction', () => {
})
})
- it('preserves catalog provenance without treating the display pin as an install target', () => {
- 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,
- catalogName: params.catalog_name,
- sha: params.sha,
- enable: true,
- force: false,
- legacyHint: null
- })
- })
-
it('routes legacy plugin-agent alias', () => {
expect(
resolveDeepLinkAction({
@@ -53,30 +29,6 @@ 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('routes blueprint composer inserts', () => {
expect(
resolveDeepLinkAction({
diff --git a/apps/desktop/src/lib/deeplink-routes.ts b/apps/desktop/src/lib/deeplink-routes.ts
index f291ab4014a..c943e234491 100644
--- a/apps/desktop/src/lib/deeplink-routes.ts
+++ b/apps/desktop/src/lib/deeplink-routes.ts
@@ -7,16 +7,7 @@ export interface DeepLinkPayload {
}
export type DeepLinkAction =
- | {
- type: 'plugin-install'
- repo: string
- enable: boolean
- force: boolean
- legacyHint: PluginInstallLegacyHint
- catalogName?: string
- sha?: string
- }
- | { type: 'skill-install'; identifier: string }
+ | { type: 'plugin-install'; repo: string; enable: boolean; force: boolean; legacyHint: PluginInstallLegacyHint }
| { type: 'composer-blueprint'; name: string; params: Record<string, string> }
| { type: 'ignore' }
@@ -39,17 +30,7 @@ export function resolveDeepLinkAction(payload: DeepLinkPayload | null | undefine
return { type: 'composer-blueprint', name: payload.name, params: payload.params || {} }
}
- 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()
+ const repo = (payload.params?.repo || payload.params?.identifier || payload.name || '').trim()
if (payload.kind === 'plugin' && payload.name === 'install' && repo) {
return {
@@ -57,9 +38,7 @@ export function resolveDeepLinkAction(payload: DeepLinkPayload | null | undefine
repo,
enable: truthyParam(payload.params?.enable, true),
force: truthyParam(payload.params?.force, false),
- legacyHint: null,
- catalogName: payload.params?.catalog_name || undefined,
- sha: payload.params?.sha || undefined
+ legacyHint: null
}
}
diff --git a/apps/desktop/src/lib/hermes-open-target.test.ts b/apps/desktop/src/lib/hermes-open-target.test.ts
index 59f8d3f4fef..35f1c7439d5 100644
--- a/apps/desktop/src/lib/hermes-open-target.test.ts
+++ b/apps/desktop/src/lib/hermes-open-target.test.ts
@@ -59,6 +59,5 @@ describe('pathFromHermesDeepLink', () => {
it('ignores reserved kinds', () => {
expect(pathFromHermesDeepLink('blueprint', 'morning-brief')).toBeNull()
expect(pathFromHermesDeepLink('plugin', 'install')).toBeNull()
- expect(pathFromHermesDeepLink('skill', 'install')).toBeNull()
})
})
diff --git a/apps/desktop/src/lib/hermes-open-target.ts b/apps/desktop/src/lib/hermes-open-target.ts
index 6c0f36bef01..a865486d1be 100644
--- a/apps/desktop/src/lib/hermes-open-target.ts
+++ b/apps/desktop/src/lib/hermes-open-target.ts
@@ -26,8 +26,7 @@ const RESERVED_DEEP_LINK_KINDS = new Set([
'plugin',
'plugin-agent',
'plugin-desktop',
- 'settings',
- 'skill'
+ 'settings'
])
function appendSearch(path: string, params: URLSearchParams | Record<string, string> | undefined): string {
diff --git a/apps/desktop/src/lib/query-client.ts b/apps/desktop/src/lib/query-client.ts
index 18280415634..cfea4f1054f 100644
--- a/apps/desktop/src/lib/query-client.ts
+++ b/apps/desktop/src/lib/query-client.ts
@@ -28,7 +28,6 @@ export const writeCache =
// previous profile's data (a bug).
const PROFILE_INDEPENDENT_QUERY_ROOTS = new Set<string>([
'billing',
- 'public-catalog',
'marketplace-themes',
'marketplace-themes-settings',
'onboarding-model-options',
diff --git a/apps/desktop/src/store/confirm.ts b/apps/desktop/src/store/confirm.ts
index d1918bdaf54..6fd6fa46d0d 100644
--- a/apps/desktop/src/store/confirm.ts
+++ b/apps/desktop/src/store/confirm.ts
@@ -4,68 +4,34 @@ export interface ConfirmRequest {
title: string
description?: string
confirmLabel?: string
- busyLabel?: string
- doneLabel?: string
- details?: { label: string; value: string }[]
- onConfirm?: () => Promise<void>
cancelLabel?: string
destructive?: boolean
}
export interface PendingConfirm extends ConfirmRequest {
- id: number
resolve: (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`. Pass onConfirm
-// to use the shared dialog's progress, completion and inline error states.
+// 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.
export function confirm(request: ConfirmRequest): Promise<boolean> {
- // 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.
+ // One modal at a time: a second ask supersedes the first, which answers no.
settleConfirm(false)
return new Promise<boolean>(resolve => {
- $confirmRequest.set({ ...request, id: ++nextRequestId, resolve })
+ $confirmRequest.set({ ...request, 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, expected?: PendingConfirm): void {
+export function settleConfirm(confirmed: boolean): void {
const pending = $confirmRequest.get()
- if (!pending || pending.phase === 'running' || (expected && pending !== expected)) {
+ if (!pending) {
return
}
diff --git a/apps/desktop/src/store/skill-deeplink-install.test.ts b/apps/desktop/src/store/skill-deeplink-install.test.ts
deleted file mode 100644
index 0b39697232d..00000000000
--- a/apps/desktop/src/store/skill-deeplink-install.test.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-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.ts
deleted file mode 100644
index 10ddedb17e8..00000000000
--- a/apps/desktop/src/store/skill-deeplink-install.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-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('catalog.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('catalog.destinationChanged'))
- }
- }
-
- await confirm({
- title: translateNow('catalog.installTitle', name),
- description: translateNow('catalog.installDescription'),
- details: [
- { label: translateNow('catalog.source'), value: identifier },
- { label: translateNow('catalog.installTo'), value: destination }
- ],
- confirmLabel: translateNow('skills.hub.install'),
- busyLabel: translateNow('catalog.installing'),
- doneLabel: translateNow('catalog.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('catalog.installComplete', name),
- message: translateNow('skills.changesApplyNewSessions')
- })
- }
- })
-}
diff --git a/apps/shared/src/catalog-install.ts b/apps/shared/src/catalog-install.ts
deleted file mode 100644
index 3f24e03c09c..00000000000
--- a/apps/shared/src/catalog-install.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-/** Install targets shared by the public docs galleries and native catalog. */
-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
-}
-
-export function pluginCatalogInstallUrl(plugin: { name: string; repo: string; subdir?: string; sha: string }): string {
- return `hermes://plugin/install?${new URLSearchParams({
- repo: plugin.subdir ? `${plugin.repo}#${plugin.subdir}` : plugin.repo,
- catalog_name: plugin.name,
- sha: plugin.sha,
- enable: '1'
- })}`
-}
diff --git a/apps/shared/src/index.ts b/apps/shared/src/index.ts
index 9d612f83ec6..c9c018149f6 100644
--- a/apps/shared/src/index.ts
+++ b/apps/shared/src/index.ts
@@ -27,7 +27,6 @@ export type {
UsageBarData,
UsageModelData
} from './billing-types'
-export { pluginCatalogInstallUrl, skillCatalogInstallIdentifier, skillCatalogInstallUrl } from './catalog-install'
export {
driveChargeSettlement,
SETTLEMENT_MAX_RETRY_AFTER_MS,