Skip to content

The agent that grows with you

revert: Skills and Plugins card catalog browser, third landing (reverts #119381)

teknium16cb7a64e5941
diff --git a/apps/desktop/DESIGN.md b/apps/desktop/DESIGN.md
index 4d216d477f5..0259f65f77e 100644
--- a/apps/desktop/DESIGN.md
+++ b/apps/desktop/DESIGN.md
@@ -235,24 +235,13 @@ Notes:
`warn`, `destructive`, `outline`, `solid` (primary fill — icon-corner counts).
Sizes: `default`, `xs`, `overlay` (titlebar glyph counts).
-Badges are inert. A metadata chip that does something (filter by category or
-tag, search a platform or tool) is a `Button` `size="xs"`: `chip` for facet
-values (soft fill + a 0.5px inset shadow ring on hover, so no reflow), `ghost`
-for quieter search values. Don't style a Badge to look clickable or add a
-separate chip component.
-
-## Reel
+## Profile rail
The profile rail keeps its create/import actions outside the scrolling squares.
Clipped horizontal edges reuse `edgeMask(edges, 'x')` from `fade-scroll.tsx`;
the default axis remains vertical for `FadeScroll`. Fitting content is unmasked,
and profile drag gestures temporarily remove the mask so the dragged square stays legible.
-`src/components/ui/reel.tsx`: one horizontal, snap-scrolling row (catalog
-category shelves, screenshot strips). Children keep their width and snap to
-the start; set it once from the parent (`className="*:w-68"`). Use it instead of
-hand-rolling `flex overflow-x-auto snap-x`.
-
## Context-sensitive dialogs
Sudo password dialogs keep the backdrop unblurred (`DialogContent`'s
@@ -261,25 +250,16 @@ password field. Long commands wrap and scroll; missing backend context is
explicit, never inferred from another tool row. Other dialogs retain the shared
blurred backdrop.
-A dialog opened from inside another (an image lightbox over a catalog detail)
-stacks above it automatically, so its backdrop dims the parent too. Media
-viewers use a heavier scrim through `overlayClassName`. Controls that belong to
-the dialog but mustn't scroll with its body (prev/next pagers) go in `chrome`,
-which may sit past the dialog's edges.
-
## Form controls
- **`controlVariants`** (`src/components/ui/control.ts`) is the shared shape for
`Input` / `Textarea` / `SelectTrigger`. New text-entry controls compose it.
- **`SearchField`** — borderless, underline-on-focus, auto-width. The only
search input. Don't build boxed search bars; don't wrap it in a bordered tile.
- `variant="box"` is the one bordered form: a full-width rounded field for
- pages where search is the primary affordance (the Skills/Plugins catalogs).
Empty lists hide their search field.
- **`SegmentedControl`** — the choice control for small mutually-exclusive sets
(color mode, tool-call display, usage period). Replaces radio piles and
- pill rows. A two-state view switch (list/cards, list/tree) is not a segmented
- control: it's one ghost `icon-xs` `Button` showing the mode it switches to.
+ pill rows.
- **`Switch`** (`size="xs"`) — bare, with `aria-label`. No bordered text wrapper.
- **`FanMenu`** (`src/components/ui/fan-menu.tsx`) — one hub control that
fans sibling toggles out on hover: `direction` `vertical` | `horizontal`
@@ -295,13 +275,6 @@ which may sit past the dialog's edges.
- **Master/detail overlays:** `OverlaySplitLayout` + `OverlaySidebar` /
`OverlayMain`. Cron, profiles, etc. ride this — don't rebuild a titlebar
shell.
-- **Filter rails** reuse the same pieces: `SidebarPanelLabel` (its `meta` slot
- carries the result count), `SidebarDateDivider` group headings, and `nested`
- `OverlayNavItem` rows. Facets are multi-select: each row is `pressed`, with a
- `CheckboxMark` in `leading` (the row is the control; a real `Checkbox` would
- nest a button), and an "All" row clears the group. No radio glyphs. A text
- "Clear" sits on the label row while anything is filtered. Cap long facets
- (tags) to the top values plus the selection; search covers the tail.
- **Settings subpages:** `OverlayNav` keeps navigation and disclosure separate:
labels navigate; the shared `DisclosureCaret` button opens a branch without
changing the page. Active paths reveal automatically, inactive paths stay
@@ -504,14 +477,6 @@ from their root base tokens; do not multiply the global tokens or nest CSS zoom.
## Direct manipulation & performance
-`Masonry` (`components/ui/masonry.tsx`) packs natural-height cards into responsive
-lanes, using CSS `display: grid-lanes` where supported. Older Electron versions
-use one ResizeObserver and frame-batched placement; child DOM/source order stays
-intact through resizing, media loading, and disclosure. It owns the shared gap;
-`--masonry-min-width` optionally changes the minimum lane width. It knows nothing
-about what it holds: catalog results and discovery shelves opt into their hover
-treatment (sibling dimming, the pointer-following glow) from the catalog's own CSS.
-
The app should feel instant under real load — long transcripts, several panes,
live streams. Design toward that:
diff --git a/apps/desktop/scripts/i18n-keys.test.mjs b/apps/desktop/scripts/i18n-keys.test.mjs
index eadf3cd7f4a..9f07d925cb2 100644
--- a/apps/desktop/scripts/i18n-keys.test.mjs
+++ b/apps/desktop/scripts/i18n-keys.test.mjs
@@ -20,6 +20,6 @@ test('the committed locales/_keys.desktop.json matches the English catalog (run
const committed = JSON.parse(readFileSync(out, 'utf8'))
assert.equal(committed.surface, SURFACE)
assert.ok(committed.keys.includes('common.save'))
- assert.ok(committed.keys.includes('catalog.results'), 'function-valued entries are keys too')
+ assert.ok(committed.keys.includes('connectorsPage.searchPlaceholder'), 'function-valued entries are keys too')
await emitDesktopKeys({ source: repoRoot, out, check: true })
})
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-alert.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-alert.tsx
deleted file mode 100644
index ac7ad928269..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-alert.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import type { ReactNode } from 'react'
-
-import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
-import { Button } from '@/components/ui/button'
-import { Codicon } from '@/components/ui/codicon'
-
-/** A load failure above the catalog results that keeps what's already shown. */
-export function CatalogAlert({
- title,
- children,
- retryLabel,
- onRetry
-}: {
- title: string
- children?: ReactNode
- retryLabel: string
- onRetry: () => void
-}) {
- return (
- <Alert className="mx-3 w-auto shrink-0" variant="warning">
- <Codicon name="warning" />
- <AlertTitle>{title}</AlertTitle>
- <AlertDescription>
- {children}
- <Button onClick={onRetry} size="xs" variant="text">
- {retryLabel}
- </Button>
- </AlertDescription>
- </Alert>
- )
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-browser.test.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-browser.test.tsx
deleted file mode 100644
index efdc090e075..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-browser.test.tsx
+++ /dev/null
@@ -1,142 +0,0 @@
-import { QueryClientProvider } from '@tanstack/react-query'
-import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
-import { useState } from 'react'
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-
-import { queryClient } from '@/lib/query-client'
-
-import { PageSearchShell } from '../../page-search-shell'
-
-import { CatalogBrowser } from './catalog-browser'
-import { type CatalogKind, parseCatalog } from './catalog-data'
-import { $catalogCardView } from './store'
-
-beforeEach(() => {
- $catalogCardView.set(true)
-})
-
-afterEach(() => {
- cleanup()
- queryClient.clear()
- $catalogCardView.set(true)
-})
-
-function setup(kind: CatalogKind) {
- const entries = parseCatalog(
- kind,
- ['alpha', 'beta'].map(name => ({
- name,
- identifier: `official/${name}`,
- installIdentifier: `official/${name}`,
- source: 'official',
- tier: 'official',
- category: name === 'alpha' ? 'memory' : 'voice',
- description: `${name} workflow`,
- repo: `https://github.com/example/${name}`,
- sourceUrl: `https://github.com/example/${name}`,
- docsUrl: `https://example.com/${name}`
- }))
- )
-
- queryClient.setQueryData(['public-catalog', kind], entries)
- const onInstall = vi.fn()
-
- function Harness() {
- const [query, setQuery] = useState('')
-
- return (
- <QueryClientProvider client={queryClient}>
- <PageSearchShell onSearchChange={setQuery} searchPlaceholder="Search catalog" searchValue={query}>
- <CatalogBrowser
- isInstalled={entry => entry.name === 'beta'}
- kind={kind}
- onInstall={onInstall}
- onQueryChange={setQuery}
- query={query}
- />
- </PageSearchShell>
- </QueryClientProvider>
- )
- }
-
- return { entries, onInstall, ...render(<Harness />) }
-}
-
-const card = (name: string) =>
- screen.getAllByRole('article').find(article => within(article).queryByRole('button', { name }))!
-
-describe.each(['skills', 'plugins'] as const)('%s catalog layouts', kind => {
- it('defaults to cards, with installed entries already switched on', () => {
- const { container } = setup(kind)
-
- expect(screen.getAllByRole('article')).toHaveLength(2)
- expect(container.querySelector('[data-catalog-list]')).toBeNull()
- expect(screen.getByRole('button', { name: 'List view' })).toBeTruthy()
- expect(
- within(card('beta')).getByRole<HTMLButtonElement>('switch', { name: 'Added beta' }).getAttribute('aria-checked')
- ).toBe('true')
- })
-
- it('installs from the card switch without opening its details', () => {
- const { entries, onInstall } = setup(kind)
-
- fireEvent.click(within(card('alpha')).getByRole('switch', { name: 'Add alpha' }))
-
- expect(onInstall).toHaveBeenCalledExactlyOnceWith(entries[0])
- expect(screen.queryByRole('dialog')).toBeNull()
- })
-
- it('opens the shared detail dialog with source links and the same install target', async () => {
- const { entries, onInstall } = setup(kind)
- fireEvent.click(screen.getByRole('button', { name: 'alpha' }))
- const dialog = screen.getByRole('dialog', { name: 'alpha' })
-
- expect(within(dialog).getByRole('link', { name: 'Repository' }).getAttribute('href')).toBe(entries[0].sourceUrl)
- expect(within(dialog).getByRole('link', { name: 'Documentation' }).getAttribute('href')).toBe(entries[0].docsUrl)
- fireEvent.click(within(dialog).getByRole('switch', { name: 'Add alpha' }))
- expect(onInstall).toHaveBeenCalledExactlyOnceWith(entries[0])
-
- if (kind === 'plugins') {
- // Release the inspector before the existing plugin installation dialog opens.
- await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull())
- } else {
- fireEvent.click(within(dialog).getByRole('button', { name: 'Close' }))
- await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull())
- }
- })
-
- it('preserves the parent search and filter when switching to list and back', async () => {
- const { container } = setup(kind)
- const search = screen.getByRole<HTMLInputElement>('textbox', { name: 'Search catalog' })
- fireEvent.change(search, { target: { value: 'workflow' } })
- fireEvent.click(screen.getByRole('button', { name: /^Memory/, pressed: false }))
- await waitFor(() => expect(screen.getAllByRole('article')).toHaveLength(1))
-
- fireEvent.click(screen.getByRole('button', { name: 'List view' }))
-
- expect(container.querySelector(`[data-catalog-list="${kind}"]`)).not.toBeNull()
- expect(screen.queryByRole('article')).toBeNull()
- expect(screen.getByRole('heading', { name: 'alpha' })).toBeTruthy()
- expect(screen.queryByRole('heading', { name: 'beta' })).toBeNull()
- expect(screen.getByRole('button', { name: /^Memory/, pressed: true })).toBeTruthy()
- expect(screen.getByRole('textbox', { name: 'Search catalog' })).toBe(search)
- expect(search.value).toBe('workflow')
-
- fireEvent.click(screen.getByRole('button', { name: 'Card view' }))
- expect(screen.getAllByRole('article')).toHaveLength(1)
- expect(screen.getByRole('button', { name: /^Memory/, pressed: true })).toBeTruthy()
- expect(screen.queryByRole('dialog')).toBeNull()
- })
-})
-
-it('shares the saved layout choice when moving between Skills and Plugins', () => {
- setup('skills')
- fireEvent.click(screen.getByRole('button', { name: 'List view' }))
- expect($catalogCardView.get()).toBe(false)
- cleanup()
-
- const { container } = setup('plugins')
- expect(container.querySelector('[data-catalog-list="plugins"]')).not.toBeNull()
- fireEvent.click(screen.getByRole('button', { name: 'Card view' }))
- expect($catalogCardView.get()).toBe(true)
-})
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx
deleted file mode 100644
index 70c36f562b5..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx
+++ /dev/null
@@ -1,473 +0,0 @@
-import { compactNumber, groupCatalogPlugins, PLUGIN_CATEGORIES } from '@hermes/shared'
-import { useStore } from '@nanostores/react'
-import { memo, type ReactNode, useDeferredValue, useEffect, useRef, useState } from 'react'
-
-import { PageLoader } from '@/components/page-loader'
-import { Button } from '@/components/ui/button'
-import { Codicon } from '@/components/ui/codicon'
-import { ErrorState } from '@/components/ui/error-state'
-import { Masonry } from '@/components/ui/masonry'
-import { Reel } from '@/components/ui/reel'
-import { SearchField } from '@/components/ui/search-field'
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
-import { Tip } from '@/components/ui/tooltip'
-import { useI18n } from '@/i18n'
-import { cn } from '@/lib/utils'
-
-import { DetailColumn, ListColumn, MasterDetail } from '../../master-detail'
-import { PanelEmpty } from '../../overlays/panel'
-
-import { CatalogAlert } from './catalog-alert'
-import { CatalogCard } from './catalog-card'
-import { type CatalogEntry, type CatalogKind, useCatalog } from './catalog-data'
-import { CatalogDetail } from './catalog-detail'
-import { CatalogDetailDialog } from './catalog-detail-dialog'
-import { CatalogFilters } from './catalog-filters'
-import { CatalogInstallSwitch } from './catalog-install-switch'
-import { CatalogListRow } from './catalog-list-row'
-import { CATALOG_POINTER_ENABLED, trackCatalogPointer } from './catalog-pointer'
-import {
- catalogCategories,
- type CatalogSort,
- catalogSortOptions,
- catalogSources,
- catalogTags,
- filterCatalog,
- relatedEntries,
- sortCatalog
-} from './catalog-query'
-import { $catalogCardView } from './store'
-import { useCatalogFilters } from './use-catalog-filters'
-
-interface CatalogBrowserProps {
- kind: CatalogKind
- query?: string
- onQueryChange?: (value: string) => void
- isInstalled: (entry: CatalogEntry) => boolean
- onInstall: (entry: CatalogEntry) => void
- isInstalling?: (entry: CatalogEntry) => boolean
- /** Feed rows the caller drops from the list entirely (e.g. a community
- * lookalike whose name is taken by an installed skill). */
- isSuperseded?: (entry: CatalogEntry) => boolean
- installedEntries?: CatalogEntry[]
- matchInstalled?: (entry: CatalogEntry) => CatalogEntry | undefined
- actions?: ReactNode
- headerActions?: ReactNode
- installedPending?: boolean
- notice?: ReactNode
- renderInstalledDetail?: (entry: CatalogEntry) => ReactNode
- renderInstalledAction?: (entry: CatalogEntry) => ReactNode
- selectedEntryId?: string | null
-}
-
-const PAGE_SIZE = 60
-// The skills hub carries ~10k distinct tags; the rail is for browsing, search covers the tail.
-const TAG_LIMIT = 16
-// Discovery shelves preview a category; "See all" opens the full list. Every
-// rendered card is restyled whenever a modal locks the page.
-const SHELF_SIZE = 6
-/** On: masonry lanes. Off: fallback grid whose rows share one height (`.catalog-grid`). */
-const CATALOG_MASONRY = true
-
-/** Merge the public feed with installed rows: a catalog entry that matches an
- * installed one takes the installed id (so selection and install state line
- * up); installed rows with no catalog match are appended. */
-function mergeInstalled(
- data: CatalogEntry[],
- installedEntries: CatalogEntry[],
- matchInstalled?: (entry: CatalogEntry) => CatalogEntry | undefined
-) {
- const remaining = new Map(installedEntries.map(entry => [entry.id, entry]))
- const seen = new Set<string>()
-
- const catalog = data.flatMap(entry => {
- const installed = matchInstalled?.(entry)
-
- if (!installed) {
- return [entry]
- }
-
- remaining.delete(installed.id)
-
- if (seen.has(installed.id)) {
- return []
- }
-
- seen.add(installed.id)
-
- return [
- {
- ...entry,
- id: installed.id,
- version: installed.version || entry.version,
- search: `${entry.search} ${installed.search}`
- }
- ]
- })
-
- return [...catalog, ...remaining.values()]
-}
-
-// Props take no destructuring defaults: React Compiler 1.0 skips components that have them.
-export const CatalogBrowser = memo(function CatalogBrowser({
- kind,
- isInstalled,
- onInstall,
- isInstalling,
- isSuperseded,
- installedEntries,
- matchInstalled,
- actions,
- headerActions,
- installedPending,
- notice,
- renderInstalledDetail,
- renderInstalledAction,
- selectedEntryId,
- query,
- onQueryChange
-}: CatalogBrowserProps) {
- const { t } = useI18n()
- const c = t.catalog
- const cardView = useStore($catalogCardView)
- const { data, isPending, error, refetch } = useCatalog(kind)
- const deferredQuery = useDeferredValue((query ?? '').trim().toLowerCase())
- const [selectedId, setSelectedId] = useState<string | null>(selectedEntryId ?? null)
- const [detailOpen, setDetailOpen] = useState(false)
- const [limit, setLimit] = useState(PAGE_SIZE)
-
- const resetSelection = () => {
- setLimit(PAGE_SIZE)
- setSelectedId(null)
- setDetailOpen(false)
- }
-
- const filters = useCatalogFilters(kind, resetSelection)
- const { facets, sort } = filters
-
- // Clearing the query only widens results, and a deep link clears it while selecting its target.
- useEffect(() => {
- setLimit(PAGE_SIZE)
-
- if (deferredQuery) {
- setSelectedId(null)
- }
- }, [deferredQuery])
-
- // A deep link asks to open one entry; selection stays local afterwards.
- useEffect(() => {
- if (!selectedEntryId) {
- return
- }
-
- setSelectedId(selectedEntryId)
- setDetailOpen(true)
- }, [selectedEntryId])
-
- const root = useRef<HTMLDivElement>(null)
- useEffect(() => (CATALOG_POINTER_ENABLED && root.current ? trackCatalogPointer(root.current) : undefined), [])
-
- const entries = mergeInstalled(data ?? [], installedEntries ?? [], matchInstalled)
- const visible = isSuperseded ? entries.filter(entry => !isSuperseded(entry)) : entries
- const filtered = sortCatalog(filterCatalog(visible, facets, deferredQuery, isInstalled), sort, kind)
-
- const discover =
- kind === 'plugins' && !facets.categories.length && !facets.tags.length && !deferredQuery && !facets.installedOnly
-
- const sections =
- discover && cardView
- ? groupCatalogPlugins(filtered).map(([key, items]) => ({ key, ...PLUGIN_CATEGORIES[key], entries: items }))
- : []
-
- const pageOrder = sections.length ? sections.flatMap(section => section.entries) : filtered
-
- const selected = visible.find(entry => entry.id === selectedId) ?? filtered[0]
- const related = selected && (!cardView || detailOpen) ? relatedEntries(filtered, selected, 3) : []
-
- const searchFor = (value: string) => {
- onQueryChange?.(value)
- resetSelection()
- }
-
- const clearFilters = () => {
- onQueryChange?.('')
- filters.clear()
- }
-
- const openEntry = (entry: CatalogEntry) => {
- setSelectedId(entry.id)
- setDetailOpen(true)
- }
-
- // Installed entries get the owner's on/off switch; the rest install one-way.
- const entryAction = (entry: CatalogEntry) => {
- const custom = renderInstalledAction?.(entry)
-
- if (custom) {
- return custom
- }
-
- const installed = isInstalled(entry)
-
- return (
- <CatalogInstallSwitch
- disabled={Boolean(installedPending) || installed || (kind === 'skills' && !entry.installIdentifier)}
- installed={installed}
- installing={isInstalling?.(entry) ?? false}
- name={entry.name}
- onInstall={() => {
- if (kind === 'plugins') {
- setDetailOpen(false)
- }
-
- onInstall(entry)
- }}
- />
- )
- }
-
- const card = (entry: CatalogEntry, accentIndex: number) => (
- <CatalogCard
- accentIndex={accentIndex}
- action={entryAction(entry)}
- entry={entry}
- key={entry.id}
- onCategory={filters.chooseCategory}
- onOpen={openEntry}
- onSearch={searchFor}
- onTag={filters.toggleTag}
- />
- )
-
- const details = selected ? (
- <CatalogDetail
- action={entryAction(selected)}
- dialog={cardView}
- entry={selected}
- kind={kind}
- management={renderInstalledDetail?.(selected)}
- onCategory={filters.chooseCategory}
- onRelated={entry => setSelectedId(entry.id)}
- onSearch={searchFor}
- onTag={filters.toggleTag}
- related={related}
- />
- ) : null
-
- const sortLabels: Record<CatalogSort, string> = {
- discover: c.featured,
- stars: c.mostStarred,
- newest: c.newest,
- updated: c.recentlyUpdated,
- name: c.alphabetical
- }
-
- const sortControl = (
- <Select onValueChange={value => filters.setSort(value as CatalogSort)} value={sort}>
- <SelectTrigger aria-label={c.sortBy} className="w-full" size="sm">
- <SelectValue placeholder={c.sortBy} />
- </SelectTrigger>
- <SelectContent>
- {catalogSortOptions(visible, kind, sortLabels).map(({ value, label }) => (
- <SelectItem key={value} value={value}>
- {label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- )
-
- const viewToggleLabel = cardView ? c.listView : c.cardView
- const filterKey = [facets.sources, facets.categories, facets.tags].map(list => list.join(',')).join(':')
-
- return (
- <div className="@container/catalog flex h-full min-h-0 min-w-0" data-catalog={kind} ref={root}>
- <div className="flex min-h-0 min-w-0 flex-1 flex-col @[48rem]/catalog:flex-row">
- <CatalogFilters
- categories={catalogCategories(visible, kind)}
- className="max-h-52 shrink-0 gap-0 pt-3 @[48rem]/catalog:max-h-none @[48rem]/catalog:w-48"
- facets={facets}
- onCategory={filters.toggleCategory}
- onClear={clearFilters}
- onInstalled={filters.toggleInstalled}
- onSource={filters.toggleSource}
- onTag={filters.toggleTag}
- resultCount={filtered.length}
- sidebarActions={actions && <div className="flex flex-wrap items-center gap-1.5">{actions}</div>}
- sortControl={sortControl}
- sources={catalogSources(visible)}
- tags={catalogTags(visible, facets.tags, TAG_LIMIT)}
- />
- <div className="flex min-h-0 min-w-0 flex-1 flex-col" data-catalog-results>
- {/* Search owns the header; kind-specific setup actions and the view toggle share the end slot. */}
- <header
- className="grid shrink-0 grid-cols-1 items-center gap-2 px-3 pb-1 pt-3 @[48rem]/catalog:grid-cols-[minmax(0,1fr)_auto] @[48rem]/catalog:gap-4"
- data-catalog-header
- >
- <SearchField
- containerClassName="w-full min-w-0"
- onChange={value => onQueryChange?.(value)}
- placeholder={kind === 'plugins' ? c.searchPlugins : c.searchSkills}
- value={query ?? ''}
- variant="box"
- />
- <div
- className="flex min-w-0 flex-wrap items-center justify-end gap-3 justify-self-end"
- data-catalog-actions
- >
- {headerActions}
- <Tip label={viewToggleLabel}>
- <Button
- aria-label={viewToggleLabel}
- onClick={() => {
- setDetailOpen(false)
- $catalogCardView.set(!cardView)
- }}
- size="icon-xs"
- variant="ghost"
- >
- <Codicon name={cardView ? 'list-unordered' : 'extensions'} />
- </Button>
- </Tip>
- </div>
- </header>
- {notice}
- {error && entries.length > 0 && (
- <CatalogAlert onRetry={() => void refetch()} retryLabel={c.retry} title={c.loadFailed}>
- {error.message}
- </CatalogAlert>
- )}
- <div className="min-h-0 flex-1">
- {isPending && !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}
- />
- ) : cardView ? (
- <>
- <div className="flex h-full min-h-0 flex-col px-3 pb-3" data-catalog-cards={kind}>
- <div
- className="min-h-0 flex-1 overflow-y-auto overscroll-contain [scrollbar-gutter:stable]"
- data-catalog-scroll
- key={`${filterKey}:${sort}:${deferredQuery}:${facets.installedOnly}`}
- >
- {discover ? (
- <div className="space-y-7 py-3">
- {sections.map((section, sectionIndex) => (
- <section className="space-y-3" data-catalog-section={section.key} key={section.key}>
- <header className="flex items-center justify-between gap-3">
- <h3 className="flex items-baseline gap-2 text-sm font-semibold">
- <Button
- className="text-sm font-semibold text-(--ui-text-primary)"
- onClick={() => filters.chooseCategory(section.key)}
- size="inline"
- variant="text"
- >
- {section.label}
- </Button>
- <span className="text-xs font-normal text-(--ui-text-tertiary)">
- {compactNumber(section.entries.length)}
- </span>
- </h3>
- <Button onClick={() => filters.chooseCategory(section.key)} size="inline" variant="text">
- {c.seeAll}
- <Codicon name="arrow-right" />
- </Button>
- </header>
- <p className="text-xs text-(--ui-text-tertiary)">{section.blurb}</p>
- <Reel className="*:w-68" data-catalog-hover-group>
- {section.entries
- .slice(0, SHELF_SIZE)
- .map((entry, index) => card(entry, sectionIndex * SHELF_SIZE + index))}
- </Reel>
- </section>
- ))}
- </div>
- ) : (
- <div className="py-2">
- {CATALOG_MASONRY ? (
- <Masonry data-catalog-hover-group>{filtered.slice(0, limit).map(card)}</Masonry>
- ) : (
- <div className="catalog-grid" data-catalog-hover-group>
- {filtered.slice(0, limit).map(card)}
- </div>
- )}
- {filtered.length > limit && (
- <Button onClick={() => setLimit(value => value + PAGE_SIZE)} size="sm" variant="text">
- {c.more}
- </Button>
- )}
- </div>
- )}
- </div>
- </div>
- <CatalogDetailDialog
- onOpenChange={setDetailOpen}
- onSelect={setSelectedId}
- open={detailOpen}
- order={pageOrder}
- selectedId={selected.id}
- >
- {details}
- </CatalogDetailDialog>
- </>
- ) : (
- <div
- className={cn('h-full min-h-0', detailOpen ? '[&_aside]:max-sm:hidden' : '[&_main]:max-sm:hidden')}
- data-catalog-list={kind}
- >
- <MasterDetail resizeId="capabilities-split" split="wide">
- <ListColumn key={`${filterKey}:${deferredQuery}`}>
- {filtered.slice(0, limit).map(entry => (
- <CatalogListRow
- entry={entry}
- installed={isInstalled(entry)}
- key={entry.id}
- kind={kind}
- onCategory={filters.chooseCategory}
- onOpen={openEntry}
- onSearch={searchFor}
- onTag={filters.toggleTag}
- selected={entry.id === selected.id}
- />
- ))}
- {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>
- {details}
- </DetailColumn>
- </MasterDetail>
- </div>
- )}
- </div>
- </div>
- </div>
- </div>
- )
-})
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-card.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-card.tsx
deleted file mode 100644
index 2450d9d15ae..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-card.tsx
+++ /dev/null
@@ -1,127 +0,0 @@
-import './catalog.css'
-
-import { type ReactNode, useState } from 'react'
-
-import { RowButton } from '@/components/ui/row-button'
-import { cn } from '@/lib/utils'
-
-import { type CatalogEntry, catalogLabel } from './catalog-data'
-import { CatalogDates, CatalogHeaderMeta, CatalogMetadata } from './catalog-metadata'
-
-export function catalogIcon(category: string) {
- const icons: Record<string, string> = {
- desktop: 'layout',
- tools: 'tools',
- memory: 'database',
- platform: 'plug',
- models: 'hubot',
- web: 'globe',
- automation: 'run-all',
- voice: 'mic',
- 'software-development': 'code',
- 'autonomous-ai-agents': 'hubot',
- productivity: 'checklist',
- creative: 'paintcan',
- research: 'beaker',
- science: 'beaker',
- security: 'shield',
- media: 'play',
- apple: 'device-desktop'
- }
-
- return icons[category] ?? 'extensions'
-}
-
-export function CatalogImage({ src, className }: { src: string; className?: string }) {
- const [failed, setFailed] = useState(false)
-
- return failed ? null : (
- <img
- alt=""
- className={cn('block w-full object-contain', className)}
- decoding="async"
- loading="lazy"
- onError={() => setFailed(true)}
- referrerPolicy="no-referrer"
- src={src}
- />
- )
-}
-
-// Shared classes, not per-card inline custom properties: identical declarations
-// let the style engine reuse computed styles across cards. catalog.css paints them.
-const CARD_ACCENTS = [
- '[--catalog-accent:var(--ui-blue)]',
- '[--catalog-accent:var(--ui-orange)]',
- '[--catalog-accent:var(--ui-purple)]',
- '[--catalog-accent:var(--ui-green)]',
- '[--catalog-accent:var(--ui-red)]',
- '[--catalog-accent:var(--ui-cyan)]',
- '[--catalog-accent:var(--ui-yellow)]'
-]
-
-interface CatalogCardProps {
- entry: CatalogEntry
- action: ReactNode
- accentIndex: number
- onOpen: (entry: CatalogEntry) => void
- onCategory: (category: string) => void
- onTag: (tag: string) => void
- onSearch: (value: string) => void
-}
-
-export function CatalogCard({ entry, action, accentIndex, onOpen, onCategory, onTag, onSearch }: CatalogCardProps) {
- return (
- <article
- className={cn(
- 'group relative flex min-w-0 flex-col overflow-hidden rounded-lg border',
- CARD_ACCENTS[accentIndex % CARD_ACCENTS.length]
- )}
- data-catalog-card
- data-entry-id={entry.id}
- >
- {entry.imageUrl && <CatalogImage className="aspect-[2/1]" key={entry.imageUrl} src={entry.imageUrl} />}
- <div className="flex min-h-0 w-full flex-1 flex-col gap-2 p-3">
- <div className="flex min-w-0 items-center gap-2.5">
- {/* Its ::after stretches over the whole card, so any empty spot opens the
- detail; real controls sit above it (`relative`). One focus stop per card. */}
- <RowButton
- aria-haspopup="dialog"
- aria-label={entry.name}
- className="min-w-0 flex-1 text-left font-semibold leading-snug after:absolute after:inset-0 after:rounded-[inherit] focus-visible:outline-none focus-visible:after:outline-2 focus-visible:after:outline-primary focus-visible:after:-outline-offset-2"
- onClick={() => onOpen(entry)}
- >
- <span className="line-clamp-2 min-w-0 break-words text-lg">{entry.name}</span>
- </RowButton>
- {action && (
- <span className="relative shrink-0 opacity-[.66] transition-opacity group-hover:opacity-100 group-focus-within:opacity-100">
- {action}
- </span>
- )}
- </div>
- {/* In a fixed-height grid cell the description is what gives way. */}
- <div className="flex min-h-0 min-w-0 flex-col gap-2">
- <span className="flex w-full items-center gap-2 text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
- <span className="min-w-0 flex-1 truncate">{entry.author || catalogLabel(entry.source)}</span>
- <CatalogHeaderMeta entry={entry} />
- </span>
- <span className="line-clamp-4 min-h-0 text-[length:var(--conversation-caption-font-size)] leading-relaxed text-(--ui-text-secondary)">
- {entry.description}
- </span>
- </div>
- </div>
- <div className="px-3 pb-3 [&_button]:relative">
- <CatalogMetadata
- entry={entry}
- onCategory={onCategory}
- onOpen={() => onOpen(entry)}
- onSearch={onSearch}
- onTag={onTag}
- />
- </div>
- <div className="mt-auto px-3 pb-3">
- <CatalogDates entry={entry} />
- </div>
- </article>
- )
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-data.test.ts b/apps/desktop/src/app/capabilities/catalog/catalog-data.test.ts
deleted file mode 100644
index d4cf590f86d..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-data.test.ts
+++ /dev/null
@@ -1,145 +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/capabilities/catalog/catalog-data.ts b/apps/desktop/src/app/capabilities/catalog/catalog-data.ts
deleted file mode 100644
index 09c8c79a168..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-data.ts
+++ /dev/null
@@ -1,275 +0,0 @@
-import { skillCatalogInstallIdentifier } from '@hermes/shared'
-import { queryOptions, useQuery } from '@tanstack/react-query'
-
-import { queryClient } from '@/lib/query-client'
-
-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[]
- middleware?: string[]
- commands?: string[]
- license?: string
- sourceUrl: string | null
- docsUrl: string | null
- /** Catalog-provided media, restricted to the same GitHub hosts as the website. */
- imageUrl: string | null
- screenshots?: string[]
- addedAt?: string
- updatedAt?: string
- 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'])
-
-// URL.parse, not `new URL` in try/catch: most skill rows carry no repo or docs
-// URL, and 200k thrown TypeErrors cost ~0.7s of main thread per catalog load.
-const parseUrl = (value: unknown) => URL.parse(text(value))
-
-/** Mirrors scripts/validate_plugin_catalog.py: https on a GitHub host, else no image. */
-export function catalogImageUrl(value: unknown): string | null {
- const url = parseUrl(value)
- const host = url?.hostname.toLowerCase() ?? ''
-
- return url?.protocol === 'https:' && (IMAGE_HOSTS.has(host) || host.endsWith('.githubusercontent.com'))
- ? url.href
- : null
-}
-
-function webUrl(value: unknown): string | null {
- const url = parseUrl(value)
-
- return url?.protocol === 'https:' || url?.protocol === 'http:' ? url.href : null
-}
-
-/** Display form of a source or category id: domains stay verbatim (`browse.sh`),
- * slugs read as words (`software-development` → `Software Development`). */
-export const catalogLabel = (value: string) =>
- value.includes('.') ? value : value.replace(/[-_]+/g, ' ').replace(/\b\w/g, c => c.toUpperCase())
-
-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 categoryLabel = text(row.categoryLabel) || category
- const tags = strings(row.tags)
- const tools = strings(caps.providesTools)
- const hooks = strings(caps.providesHooks)
- const middleware = strings(caps.providesMiddleware)
- const commands = strings(row.commands)
- const platforms = strings(row.platforms)
- const requirements = strings(kind === 'plugins' ? caps.requiresEnv : row.envVars)
- const author = text(row.maintainer ?? row.author)
- const description = text(row.description)
-
- entries.set(id, {
- id,
- name,
- description,
- overview: text(row.overview),
- category,
- categoryLabel,
- 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,
- middleware,
- commands,
- license: text(row.license) || undefined,
- platforms,
- requirements,
- 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,
- screenshots:
- kind === 'plugins'
- ? strings(row.screenshots)
- .map(catalogImageUrl)
- .filter((url): url is string => url !== null)
- : [],
- addedAt: Number.isFinite(Date.parse(text(row.addedAt))) ? text(row.addedAt) : undefined,
- updatedAt: Number.isFinite(Date.parse(text(row.updatedAt))) ? text(row.updatedAt) : undefined,
- stars: typeof row.stars === 'number' && Number.isFinite(row.stars) ? row.stars : null,
- search: [
- name,
- description,
- text(row.overview),
- author,
- category,
- categoryLabel,
- source,
- ...tags,
- ...tools,
- ...hooks,
- ...platforms,
- ...requirements,
- ...commands,
- ...middleware
- ]
- .filter(Boolean)
- .join(' ')
- .toLowerCase()
- })
- }
-
- return [...entries.values()]
-}
-
-export async function fetchCatalog(kind: CatalogKind): Promise<CatalogEntry[]> {
- // Bound inactivity, not total transfer time: a large skills snapshot can
- // take minutes on a healthy slow connection. Headers and each body chunk
- // get the same deadline; an actually stalled download still terminates.
- const controller = new AbortController()
- let timer: ReturnType<typeof setTimeout> | undefined
-
- const armDeadline = () => {
- clearTimeout(timer)
- timer = setTimeout(() => controller.abort(), 60_000)
- }
-
- armDeadline()
-
- try {
- // Same published snapshots as the docs galleries; no per-entry fan-out.
- const response = await fetch(`${CATALOG_BASE}/${kind}.json`, {
- credentials: 'omit',
- signal: controller.signal
- })
-
- if (!response.ok) {
- throw new Error(`Catalog HTTP ${response.status}`)
- }
-
- if (!response.body) {
- return parseCatalog(kind, await response.json())
- }
-
- const reader = response.body.getReader()
- const decoder = new TextDecoder()
- const chunks: string[] = []
- armDeadline()
-
- try {
- while (true) {
- const { done, value } = await reader.read()
-
- if (done) {
- break
- }
-
- if (value.byteLength > 0) {
- armDeadline()
- }
-
- chunks.push(decoder.decode(value, { stream: true }))
- }
- } finally {
- reader.releaseLock()
- }
-
- clearTimeout(timer)
- chunks.push(decoder.decode())
-
- return parseCatalog(kind, JSON.parse(chunks.join('')))
- } catch (error) {
- // Chromium can turn our abort into "The user aborted a request." The
- // controller, not that browser-dependent exception name, owns the cause.
- if (controller.signal.aborted) {
- throw new Error('Catalog download timed out after 60 seconds without progress. Please try again.')
- }
-
- throw error
- } finally {
- clearTimeout(timer)
- }
-}
-
-const catalogQuery = (kind: CatalogKind) =>
- queryOptions({
- queryKey: ['public-catalog', kind],
- queryFn: () => fetchCatalog(kind),
- staleTime: 30 * 60_000,
- // The skills snapshot parses to ~100k rows; release it once the page has
- // been left long enough that a revisit is a fresh browse anyway.
- gcTime: 30 * 60_000,
- refetchOnWindowFocus: false,
- refetchOnReconnect: false,
- refetchOnMount: false,
- retryOnMount: false,
- retry: false
- })
-
-export function useCatalog(kind: CatalogKind) {
- return useQuery({
- ...catalogQuery(kind),
- // A failed catalog stays parked across remounts (tab switches) until the
- // user explicitly chooses Try again.
- enabled: query => query.state.status !== 'error'
- })
-}
-
-/** Warm a catalog while the browser is idle so switching tabs doesn't pay the fetch + parse. */
-export function prefetchCatalogWhenIdle(kind: CatalogKind) {
- const id = requestIdleCallback(() => void queryClient.prefetchQuery(catalogQuery(kind)), { timeout: 5_000 })
-
- return () => cancelIdleCallback(id)
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-detail-dialog.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-detail-dialog.tsx
deleted file mode 100644
index e7c395f8707..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-detail-dialog.tsx
+++ /dev/null
@@ -1,95 +0,0 @@
-import type { ReactNode } from 'react'
-
-import { Button } from '@/components/ui/button'
-import { Codicon } from '@/components/ui/codicon'
-import { Dialog, DialogContent } from '@/components/ui/dialog'
-import { useI18n } from '@/i18n'
-
-import type { CatalogEntry } from './catalog-data'
-
-interface CatalogDetailDialogProps {
- open: boolean
- onOpenChange: (open: boolean) => void
- /** On-screen order to page through; wraps at both ends. */
- order: CatalogEntry[]
- selectedId: string
- onSelect: (id: string) => void
- children: ReactNode
-}
-
-const EDITABLE = 'input, textarea, [contenteditable="true"]'
-
-export function CatalogDetailDialog({
- open,
- onOpenChange,
- order,
- selectedId,
- onSelect,
- children
-}: CatalogDetailDialogProps) {
- const { t } = useI18n()
- const pageable = order.length > 1
-
- const step = (delta: number) => {
- if (!pageable) {
- return
- }
-
- const index = order.findIndex(entry => entry.id === selectedId)
- onSelect(order[(index + delta + order.length) % order.length].id)
- }
-
- const pager = (delta: -1 | 1) => (
- <Button
- aria-label={delta < 0 ? t.ui.pagination.previous : t.ui.pagination.next}
- className={
- delta < 0
- ? 'absolute -left-14 top-1/2 -translate-y-1/2 max-sm:left-2'
- : 'absolute -right-14 top-1/2 -translate-y-1/2 max-sm:right-2'
- }
- onClick={() => step(delta)}
- size="icon-lg"
- variant="ghost"
- >
- <Codicon name={delta < 0 ? 'chevron-left' : 'chevron-right'} />
- </Button>
- )
-
- return (
- <Dialog onOpenChange={onOpenChange} open={open}>
- <DialogContent
- aria-describedby={undefined}
- bodyClassName="gap-5"
- chrome={
- pageable && (
- <>
- {pager(-1)}
- {pager(1)}
- </>
- )
- }
- className="max-w-2xl"
- // Focus returns to the card of the entry the user paged to, when it's rendered.
- onCloseAutoFocus={event => {
- event.preventDefault()
- document
- .querySelector<HTMLElement>(`[data-entry-id="${CSS.escape(selectedId)}"] [aria-haspopup="dialog"]`)
- ?.focus({ preventScroll: true })
- }}
- onKeyDown={event => {
- if (
- (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') ||
- (event.target as HTMLElement).closest(EDITABLE)
- ) {
- return
- }
-
- event.preventDefault()
- step(event.key === 'ArrowLeft' ? -1 : 1)
- }}
- >
- {children}
- </DialogContent>
- </Dialog>
- )
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-detail.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-detail.tsx
deleted file mode 100644
index 7bb27a9163f..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-detail.tsx
+++ /dev/null
@@ -1,196 +0,0 @@
-import { type ReactNode, useLayoutEffect, useRef } from 'react'
-
-import { ZoomableImage } from '@/components/chat/zoomable-image'
-import { Badge } from '@/components/ui/badge'
-import { Button } from '@/components/ui/button'
-import { Codicon } from '@/components/ui/codicon'
-import { DialogTitle } from '@/components/ui/dialog'
-import { Reel } from '@/components/ui/reel'
-import { RowButton } from '@/components/ui/row-button'
-import { useI18n } from '@/i18n'
-import { ExternalLink } from '@/lib/external-link'
-import { cn } from '@/lib/utils'
-
-import { catalogIcon, CatalogImage } from './catalog-card'
-import { type CatalogEntry, type CatalogKind, catalogLabel } from './catalog-data'
-import { CatalogDates, CatalogHeaderMeta, CatalogMetadata } from './catalog-metadata'
-
-interface CatalogDetailProps {
- entry: CatalogEntry
- kind: CatalogKind
- action?: ReactNode
- management?: ReactNode
- related: CatalogEntry[]
- onCategory?: (category: string) => void
- onTag?: (tag: string) => void
- onSearch?: (value: string) => void
- onRelated?: (entry: CatalogEntry) => void
- /** Inside the modal: the hero bleeds to the edges and paging scrolls back to the top. */
- dialog: boolean
-}
-
-/** The shared catalog inspector used by both Skills and Plugins. No destructuring
- * defaults: React Compiler 1.0 bails on this component with them. */
-export function CatalogDetail({
- entry,
- kind,
- action,
- management,
- related,
- onCategory,
- onTag,
- onSearch,
- onRelated,
- dialog
-}: CatalogDetailProps) {
- const { t } = useI18n()
- const c = t.catalog
- const root = useRef<HTMLDivElement>(null)
- const Title = dialog ? DialogTitle : 'h3'
-
- // In the modal the body (this root's parent) is the scroller; a new entry starts at its top.
- useLayoutEffect(() => {
- if (dialog) {
- root.current?.parentElement?.scrollTo({ top: 0 })
- }
- }, [dialog, entry.id])
-
- const metadata = [
- [c.platforms, entry.platforms.join(', ')],
- [c.requires, entry.requiresHermes ? `Hermes ${entry.requiresHermes}` : ''],
- [c.pinned, entry.sha ? <code>{entry.sha.slice(0, 8)}</code> : '']
- ] as [string, ReactNode][]
-
- return (
- <div className="min-w-0 space-y-5" data-catalog-detail={kind} ref={root}>
- {entry.imageUrl && (
- <CatalogImage
- className={cn(
- 'aspect-[2/1] object-cover',
- dialog ? '-mx-4 -mt-4 w-[calc(100%+2rem)] max-w-none rounded-t-xl' : 'w-full rounded-md'
- )}
- key={entry.imageUrl}
- src={entry.imageUrl}
- />
- )}
- <header className="space-y-3">
- <div className="flex min-w-0 items-start gap-3">
- <div className="min-w-0 flex-1">
- <div className={cn('flex min-w-0 items-center gap-2', dialog && !entry.imageUrl && 'pr-7')}>
- <Title className="min-w-0 flex-1 break-words text-lg font-semibold tracking-tight">{entry.name}</Title>
- {action && <span className="shrink-0">{action}</span>}
- </div>
- <div className="mt-1 flex min-w-0 items-center gap-2 text-xs text-(--ui-text-tertiary)">
- <span className="min-w-0 truncate">{entry.author || catalogLabel(entry.source)}</span>
- <CatalogHeaderMeta entry={entry} />
- </div>
- </div>
- </div>
- {(entry.sourceUrl || entry.docsUrl) && (
- <div className="flex flex-wrap gap-3 text-xs">
- {entry.sourceUrl && <ExternalLink href={entry.sourceUrl}>{c.repository}</ExternalLink>}
- {entry.docsUrl && <ExternalLink href={entry.docsUrl}>{c.documentation}</ExternalLink>}
- </div>
- )}
- </header>
-
- <p className="whitespace-pre-wrap break-words text-[length:var(--conversation-caption-font-size)] leading-relaxed text-(--ui-text-secondary)">
- {entry.description}
- </p>
- {entry.overview && entry.overview !== entry.description && (
- <p className="whitespace-pre-wrap break-words text-[length:var(--conversation-caption-font-size)] leading-relaxed text-(--ui-text-tertiary)">
- {entry.overview}
- </p>
- )}
-
- <div className="space-y-3">
- <CatalogMetadata entry={entry} limit={Infinity} onCategory={onCategory} onSearch={onSearch} onTag={onTag} />
- <CatalogDates entry={entry} />
- <dl className="grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-2 text-[length:var(--conversation-caption-font-size)]">
- {metadata
- .filter(([, value]) => Boolean(value))
- .map(([label, value]) => (
- <div className="contents" key={label}>
- <dt className="whitespace-nowrap text-(--ui-text-tertiary)">{label}</dt>
- <dd className="m-0 break-words">{value}</dd>
- </div>
- ))}
- </dl>
- </div>
-
- {management}
-
- {Boolean(entry.screenshots?.length) && (
- <section className="space-y-2">
- <h4 className="text-xs font-medium">{c.screenshots}</h4>
- <Reel className={cn(dialog && '-mx-4 scroll-px-4 px-4')}>
- {entry.screenshots?.map((url, index) => (
- <ZoomableImage
- alt={`${c.screenshots} — ${entry.name} ${index + 1}`}
- className="h-56 w-auto max-w-none cursor-zoom-in rounded-lg border border-(--ui-stroke-tertiary)"
- decoding="async"
- key={url}
- loading="lazy"
- referrerPolicy="no-referrer"
- slot="catalog-screenshot"
- src={url}
- />
- ))}
- </Reel>
- </section>
- )}
-
- {[
- [c.tools, entry.tools],
- [c.hooks, entry.hooks],
- [c.middleware, entry.middleware ?? []],
- [c.requires, entry.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 =>
- onSearch ? (
- <Button key={value} onClick={() => onSearch(value)} size="xs" variant="ghost">
- {value}
- </Button>
- ) : (
- <Badge key={value} variant="muted">
- {value}
- </Badge>
- )
- )}
- </div>
- </section>
- ) : null
- )}
-
- <p className="text-[0.65rem] leading-relaxed text-(--ui-text-quaternary)">{c.installHint}</p>
-
- {related.length > 0 && (
- <section className="space-y-2">
- <h4 className="text-xs font-medium">{c.related}</h4>
- <div className="grid grid-cols-3 gap-2">
- {related.map(item => (
- <RowButton
- className="row-hover flex min-w-0 flex-col gap-1 overflow-hidden rounded-md text-left"
- key={item.id}
- onClick={() => onRelated?.(item)}
- >
- {item.imageUrl ? (
- <CatalogImage className="aspect-[2/1] w-full rounded-t-md object-contain" src={item.imageUrl} />
- ) : (
- <span className="flex aspect-[2/1] w-full items-center justify-center bg-(--ui-bg-quaternary) text-(--ui-text-tertiary)">
- <Codicon name={catalogIcon(item.category)} size="1.25rem" />
- </span>
- )}
- <span className="w-full truncate px-2 pb-2 text-xs font-medium">{item.name}</span>
- </RowButton>
- ))}
- </div>
- </section>
- )}
- </div>
- )
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-download.test.ts b/apps/desktop/src/app/capabilities/catalog/catalog-download.test.ts
deleted file mode 100644
index 05ca9999d5d..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-download.test.ts
+++ /dev/null
@@ -1,139 +0,0 @@
-// @vitest-environment node
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
-
-import { fetchCatalog } from './catalog-data'
-
-beforeEach(() => {
- vi.useFakeTimers()
- // Node's native timeout uses internal timers; keep the baseline's browser
- // timeout on the same deterministic clock as the response fixture.
- vi.spyOn(AbortSignal, 'timeout').mockImplementation(ms => {
- const controller = new AbortController()
- setTimeout(() => controller.abort(new DOMException('Timed out', 'TimeoutError')), ms)
-
- return controller.signal
- })
-})
-
-afterEach(() => {
- vi.restoreAllMocks()
- vi.unstubAllGlobals()
- vi.useRealTimers()
-})
-
-function serveStream() {
- let writer!: ReadableStreamDefaultController<Uint8Array>
- let signal!: AbortSignal
- const encoder = new TextEncoder()
- vi.stubGlobal(
- 'fetch',
- vi.fn(async (_url, options) => {
- signal = options.signal
-
- return new Response(
- new ReadableStream<Uint8Array>({
- start(controller) {
- writer = controller
- signal.addEventListener('abort', () =>
- controller.error(new DOMException('The user aborted a request.', 'AbortError'))
- )
- }
- })
- )
- })
- )
-
- return {
- send: (text: string) => writer.enqueue(encoder.encode(text)),
- close: () => writer.close(),
- fail: (error: Error) => writer.error(error),
- signal: () => signal
- }
-}
-
-describe('catalog download liveness', () => {
- it.each(['skills', 'plugins'] as const)(
- 'finishes a progressing %s download beyond the old total deadline',
- async kind => {
- const stream = serveStream()
-
- const result = fetchCatalog(kind).then(
- value => ({ value }),
- error => ({ error })
- )
-
- await vi.advanceTimersByTimeAsync(40_000)
- stream.send('[{"name":"slow-')
- await vi.advanceTimersByTimeAsync(40_000)
- expect(stream.signal().aborted).toBe(false)
- stream.send('catalog","source":"official"}]')
- stream.close()
- expect(await result).toMatchObject({ value: [{ name: 'slow-catalog' }] })
- expect(vi.getTimerCount()).toBe(0)
- }
- )
-
- it('reports a stalled body as a timeout, not user cancellation', async () => {
- const stream = serveStream()
- const result = fetchCatalog('skills').catch(error => error)
- await vi.advanceTimersByTimeAsync(40_000)
- stream.send('[')
- await vi.advanceTimersByTimeAsync(60_001)
- expect(stream.signal().aborted).toBe(true)
- expect((await result).message).toMatch(/timed out/i)
- expect(vi.getTimerCount()).toBe(0)
- })
-
- it('bounds waiting for response headers', async () => {
- vi.stubGlobal(
- 'fetch',
- vi.fn(
- (_url, options) =>
- new Promise((_resolve, reject) => {
- options.signal.addEventListener('abort', () =>
- reject(new DOMException('The user aborted a request.', 'AbortError'))
- )
- })
- )
- )
- const result = fetchCatalog('skills').catch(error => error)
- await vi.advanceTimersByTimeAsync(60_001)
- expect((await result).message).toMatch(/timed out/i)
- expect(vi.getTimerCount()).toBe(0)
- })
-
- it.each(['[]', 'not json'])('cleans its deadline after completion or malformed JSON: %s', async body => {
- vi.stubGlobal(
- 'fetch',
- vi.fn(async () => new Response(body))
- )
- const result = await fetchCatalog('skills').catch(error => error)
-
- if (body === '[]') {
- expect(result).toEqual([])
- } else {
- expect(result).toBeInstanceOf(SyntaxError)
- }
-
- expect(vi.getTimerCount()).toBe(0)
- })
-
- it('preserves transport errors and releases its deadline', async () => {
- const stream = serveStream()
- const error = new Error('connection reset')
- const result = fetchCatalog('skills').catch(error => error)
- await vi.advanceTimersByTimeAsync(1)
- stream.fail(error)
- expect(await result).toBe(error)
- expect(vi.getTimerCount()).toBe(0)
- })
-
- it('preserves HTTP errors and releases its deadline', async () => {
- vi.stubGlobal(
- 'fetch',
- vi.fn(async () => new Response('', { status: 503 }))
- )
- await expect(fetchCatalog('plugins')).rejects.toThrow('Catalog HTTP 503')
- expect(vi.getTimerCount()).toBe(0)
- })
-})
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-filters.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-filters.tsx
deleted file mode 100644
index e0df09425ba..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-filters.tsx
+++ /dev/null
@@ -1,142 +0,0 @@
-import { compactNumber } from '@hermes/shared'
-import type { ReactNode } from 'react'
-
-import { SidebarDateDivider, SidebarSectionMeta } from '@/app/chat/sidebar/chrome'
-import { OverlayNavItem, OverlaySidebar } from '@/app/overlays/overlay-split-layout'
-import { SidebarPanelLabel } from '@/app/shell/sidebar-label'
-import { Button } from '@/components/ui/button'
-import { CheckboxMark } from '@/components/ui/checkbox'
-import { useI18n } from '@/i18n'
-
-import { catalogLabel } from './catalog-data'
-import type { CatalogFacets } from './catalog-query'
-
-export interface FacetRow {
- value: string
- label: string
- count?: number
-}
-
-interface CatalogFiltersProps {
- sources: string[]
- categories: ReadonlyArray<readonly [string, { label: string; count: number }]>
- tags: FacetRow[]
- facets: CatalogFacets
- /** `null` clears the facet. */
- onSource: (value: string | null) => void
- onCategory: (value: string | null) => void
- onTag: (value: string | null) => void
- onInstalled: () => void
- onClear: () => void
- resultCount: number
- sidebarActions?: ReactNode
- sortControl?: ReactNode
- className?: string
-}
-
-function FacetItem({ row, active, onClick }: { row: FacetRow; active: boolean; onClick: () => void }) {
- return (
- <OverlayNavItem
- active={active}
- current={false}
- label={row.label}
- leading={<CheckboxMark checked={active} />}
- nested
- onClick={onClick}
- pressed={active}
- trailing={
- row.count !== undefined ? <SidebarSectionMeta>{compactNumber(row.count)}</SidebarSectionMeta> : undefined
- }
- />
- )
-}
-
-/** Multi-select group: rows toggle, the optional "All" row clears. */
-function Facet({
- label,
- all,
- beforeRows,
- rows,
- active,
- onSelect
-}: {
- label: string
- all?: string
- beforeRows?: ReactNode
- rows: FacetRow[]
- active: string[]
- onSelect: (value: string | null) => void
-}) {
- if (!all && !rows.length) {
- return null
- }
-
- return (
- <>
- <SidebarDateDivider label={label} />
- {all && <FacetItem active={!active.length} onClick={() => onSelect(null)} row={{ value: 'all', label: all }} />}
- {beforeRows}
- {rows.map(row => (
- <FacetItem active={active.includes(row.value)} key={row.value} onClick={() => onSelect(row.value)} row={row} />
- ))}
- </>
- )
-}
-
-export function CatalogFilters({
- sources,
- categories,
- tags,
- facets,
- onSource,
- onCategory,
- onTag,
- onInstalled,
- onClear,
- resultCount,
- sidebarActions,
- sortControl,
- className
-}: CatalogFiltersProps) {
- const { t } = useI18n()
- const c = t.catalog
- const filtered = facets.sources.length + facets.categories.length + facets.tags.length > 0 || facets.installedOnly
-
- return (
- <OverlaySidebar className={className}>
- <div className="flex h-7 shrink-0 items-center gap-2 pb-1">
- <SidebarPanelLabel meta={compactNumber(resultCount)}>{c.discover}</SidebarPanelLabel>
- {filtered && (
- <Button aria-label={c.clearFilters} className="ml-auto" onClick={onClear} size="inline" variant="text">
- {t.common.clear}
- </Button>
- )}
- </div>
-
- <div className="pb-2">{sortControl}</div>
- <Facet
- active={facets.sources}
- all={c.allSources}
- beforeRows={
- <FacetItem
- active={facets.installedOnly}
- onClick={onInstalled}
- row={{ value: 'installed', label: c.installed }}
- />
- }
- label={c.source}
- onSelect={onSource}
- rows={sources.map(value => ({ value, label: catalogLabel(value) }))}
- />
- <Facet
- active={facets.categories}
- all={c.allCategories}
- label={c.category}
- onSelect={onCategory}
- rows={categories.map(([value, { label, count }]) => ({ value, label: catalogLabel(label), count }))}
- />
- <Facet active={facets.tags} label={c.tags} onSelect={onTag} rows={tags} />
- {sidebarActions}
- </OverlaySidebar>
- )
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-install-switch.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-install-switch.tsx
deleted file mode 100644
index 157332d90f9..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-install-switch.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import { Switch } from '@/components/ui/switch'
-import { Tip } from '@/components/ui/tooltip'
-import { useI18n } from '@/i18n'
-import { Loader2 } from '@/lib/icons'
-
-interface CatalogInstallSwitchProps {
- name: string
- installed: boolean
- installing: boolean
- disabled: boolean
- onInstall: () => void
-}
-
-/** Turning it on installs. Installed entries normally show their owner's on/off
- * switch instead; this one only stays checked (and disabled) as a fallback. */
-export function CatalogInstallSwitch({ name, installed, installing, disabled, onInstall }: CatalogInstallSwitchProps) {
- const { t } = useI18n()
- const label = `${installed ? t.catalog.added : t.catalog.add} ${name}`
-
- return (
- <Tip label={label}>
- <span className="inline-flex items-center gap-2">
- {installing && <Loader2 className="size-3 animate-spin text-(--ui-text-tertiary)" />}
- <Switch
- aria-busy={installing}
- aria-label={label}
- checked={installed}
- disabled={disabled || installing}
- onCheckedChange={checked => checked && onInstall()}
- size="xs"
- />
- </span>
- </Tip>
- )
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-list-row.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-list-row.tsx
deleted file mode 100644
index f933fb7e25e..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-list-row.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import { Codicon } from '@/components/ui/codicon'
-import { RowButton } from '@/components/ui/row-button'
-import { cn } from '@/lib/utils'
-
-import { type CatalogEntry, type CatalogKind, catalogLabel } from './catalog-data'
-import { CatalogHeaderMeta, CatalogMetadata } from './catalog-metadata'
-
-interface CatalogListRowProps {
- entry: CatalogEntry
- kind: CatalogKind
- selected: boolean
- installed: boolean
- onOpen: (entry: CatalogEntry) => void
- onCategory: (category: string) => void
- onTag: (tag: string) => void
- onSearch: (value: string) => void
-}
-
-export function CatalogListRow({
- entry,
- kind,
- selected,
- installed,
- onOpen,
- onCategory,
- onTag,
- onSearch
-}: CatalogListRowProps) {
- return (
- <div
- className={cn(
- 'row-hover relative flex w-full min-w-0 items-start gap-3 rounded-md px-2 py-2 text-left',
- selected && 'bg-(--ui-row-active-background)'
- )}
- data-entry-id={entry.id}
- >
- <RowButton
- aria-label={entry.name}
- aria-pressed={selected}
- className="absolute inset-0 rounded-md focus-visible:outline-2 focus-visible:outline-primary focus-visible:-outline-offset-2"
- onClick={() => onOpen(entry)}
- />
- <Codicon
- className="mt-0.5 shrink-0 text-(--ui-text-tertiary)"
- name={kind === 'plugins' ? 'extensions' : 'book'}
- size="1.1rem"
- />
- <span className="pointer-events-none min-w-0 flex-1">
- <span className="flex items-center gap-2">
- <span className="truncate text-[0.78rem] font-medium">{entry.name}</span>
- {installed && <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="pointer-events-auto relative mt-2 block">
- <CatalogMetadata entry={entry} limit={2} onCategory={onCategory} onSearch={onSearch} onTag={onTag} />
- </span>
- <span className="mt-1.5 flex items-center gap-2 text-[0.65rem] text-(--ui-text-quaternary)">
- <span className="min-w-0 flex-1 truncate">{entry.author || catalogLabel(entry.source)}</span>
- <CatalogHeaderMeta entry={entry} />
- </span>
- </span>
- </div>
- )
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-metadata.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-metadata.tsx
deleted file mode 100644
index 9ad270f6a1b..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-metadata.tsx
+++ /dev/null
@@ -1,189 +0,0 @@
-import { compactNumber } from '@hermes/shared'
-import { useState } from 'react'
-
-import { Badge } from '@/components/ui/badge'
-import { Button } from '@/components/ui/button'
-import { Codicon } from '@/components/ui/codicon'
-import { Tip } from '@/components/ui/tooltip'
-import { useI18n } from '@/i18n'
-import { fmtDateTime, relativeTime } from '@/lib/time'
-
-import { type CatalogEntry, catalogLabel } from './catalog-data'
-
-interface CatalogMetadataProps {
- entry: CatalogEntry
- onCategory?: (category: string) => void
- onTag?: (tag: string) => void
- /** Values without a facet (platforms, tools, env vars) browse by search. */
- onSearch?: (value: string) => void
- /** Capability counts open the entry, where each value is listed. */
- onOpen?: () => void
- /** Details show everything; cards can disclose the rest without opening. */
- limit?: number
-}
-
-interface CatalogChip {
- id: string
- label: string
- hint?: string
- quiet?: boolean
- onClick?: () => void
-}
-
-/** Source, version and stars, trailing the author line. */
-export function CatalogHeaderMeta({ entry }: { entry: CatalogEntry }) {
- return (
- <span className="flex min-w-0 shrink-0 items-center gap-1">
- {entry.source && (
- <Badge className="max-w-full" size="xs" variant="muted">
- <span className="truncate">{catalogLabel(entry.source)}</span>
- </Badge>
- )}
- {entry.version && (
- <Badge size="xs" variant="muted">
- v{entry.version}
- </Badge>
- )}
- {entry.stars !== null && entry.stars > 0 && (
- <span className="flex shrink-0 items-center gap-0.5 text-[0.65rem] text-(--ui-text-tertiary)">
- <Codicon name="star-full" size="0.65rem" />
- {compactNumber(entry.stars)}
- </span>
- )}
- </span>
- )
-}
-
-/** One metadata projection for Skills and Plugins, in cards, lists and details. */
-export function CatalogMetadata({ entry, onCategory, onTag, onSearch, onOpen, limit }: CatalogMetadataProps) {
- const { t } = useI18n()
- const c = t.catalog
- const [expanded, setExpanded] = useState(false)
- const interactive = Boolean(onCategory || onTag)
- const tags = [...new Set(entry.tags)]
- const search = (value: string) => (onSearch ? () => onSearch(value) : undefined)
-
- const primary: CatalogChip[] = [
- {
- id: 'category',
- label: catalogLabel(entry.categoryLabel),
- onClick: onCategory ? () => onCategory(entry.category) : undefined
- },
- ...entry.platforms.map(value => ({
- id: `platform:${value}`,
- label: value === 'macos' ? 'macOS' : catalogLabel(value),
- quiet: true,
- onClick: search(value)
- }))
- ]
-
- const capabilities = [
- { id: 'tools', label: c.tools, values: entry.tools },
- { id: 'hooks', label: c.hooks, values: entry.hooks },
- { id: 'middleware', label: c.middleware, values: entry.middleware ?? [] }
- ]
-
- const primaryLabels = new Set(primary.map(chip => chip.label.trim().toLowerCase()))
-
- for (const chip of primary) {
- const matchingTag = tags.find(tag => tag.trim().toLowerCase() === chip.label.trim().toLowerCase())
-
- if (matchingTag && onTag && (chip.quiet || !chip.onClick)) {
- chip.onClick = () => onTag(matchingTag)
- }
- }
-
- const secondary: CatalogChip[] = [
- ...capabilities
- .filter(group => group.values.length)
- .map(group => ({ id: group.id, label: `${group.label} ${group.values.length}`, quiet: true, onClick: onOpen })),
- ...tags
- .filter(value => !primaryLabels.has(value.trim().toLowerCase()))
- .map(value => ({ id: `tag:${value}`, label: value, onClick: onTag ? () => onTag(value) : undefined })),
- ...entry.requirements.map(value => ({
- id: `env:${value}`,
- label: value,
- hint: c.requires,
- quiet: true,
- onClick: search(value)
- }))
- ]
-
- const commands = (entry.commands ?? []).map(value => `/${value.replace(/^\//, '')}`)
- const visible = expanded ? secondary : secondary.slice(0, limit ?? 5)
- const remaining = secondary.length - visible.length
-
- const chip = ({ id, label, hint, quiet, onClick }: CatalogChip) => {
- const content = onClick ? (
- <Button className="max-w-full" onClick={onClick} size="xs" variant={quiet ? 'ghost' : 'chip'}>
- <span className="truncate">{label}</span>
- </Button>
- ) : (
- <Badge className="max-w-full" variant="muted">
- <span className="truncate">{label}</span>
- </Badge>
- )
-
- return hint ? (
- <Tip key={id} label={hint}>
- {content}
- </Tip>
- ) : (
- <span className="inline-flex max-w-full" key={id}>
- {content}
- </span>
- )
- }
-
- return (
- <span className="flex flex-col gap-2" data-catalog-metadata>
- <span className="flex flex-wrap items-center gap-1">{primary.filter(item => item.label).map(chip)}</span>
- {secondary.length > 0 && (
- <span className="flex flex-wrap items-center gap-1" data-catalog-tags>
- {visible.map(chip)}
- {remaining > 0 &&
- (interactive ? (
- <Button
- aria-label={`${c.more} (${remaining})`}
- onClick={() => setExpanded(true)}
- size="xs"
- variant="ghost"
- >
- +{remaining}
- </Button>
- ) : (
- <Badge variant="muted">+{remaining}</Badge>
- ))}
- </span>
- )}
- {commands.length > 0 && (
- <span className="truncate font-mono text-[0.65rem] text-(--ui-text-tertiary)" data-catalog-commands>
- {commands.join(' ')}
- </span>
- )}
- </span>
- )
-}
-
-export function CatalogDates({ entry }: { entry: CatalogEntry }) {
- const { t } = useI18n()
-
- const dates = [
- { label: t.catalog.addedDate, value: entry.addedAt },
- { label: t.catalog.updatedDate, value: entry.updatedAt !== entry.addedAt ? entry.updatedAt : undefined }
- ].filter((date): date is { label: string; value: string } => Boolean(date.value))
-
- if (!dates.length) {
- return null
- }
-
- return (
- <span className="flex flex-wrap gap-x-2 gap-y-1 text-[0.65rem] text-(--ui-text-tertiary)">
- {dates.map(({ label, value }) => (
- <time dateTime={value} key={label} title={fmtDateTime.format(Date.parse(value))}>
- {label} {relativeTime(Date.parse(value))}
- </time>
- ))}
- </span>
- )
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-pointer.ts b/apps/desktop/src/app/capabilities/catalog/catalog-pointer.ts
deleted file mode 100644
index 436eb8631fa..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-pointer.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-/** Off for now: without it every card rests at its theme's gradient anchor. */
-export const CATALOG_POINTER_ENABLED = false
-
-const FALLOFF_PX = 480
-
-/**
- * Aims every card's gradient at the pointer. The gradient center is the pointer
- * clamped to the card, so it is radial under the pointer and anchored to the
- * nearest edge otherwise; `--catalog-near` fades 1 → 0 over FALLOFF_PX of
- * distance from that edge point. Reads all rects, then writes, once per frame.
- */
-export function trackCatalogPointer(root: HTMLElement) {
- let frame = 0
- let x = 0
- let y = 0
-
- const paint = () => {
- frame = 0
- const cards = [...root.querySelectorAll<HTMLElement>('[data-catalog-card]')]
- const rects = cards.map(card => card.getBoundingClientRect())
-
- cards.forEach((card, index) => {
- const { left, top, right, bottom, width, height } = rects[index]
-
- if (bottom < 0 || top > innerHeight) {
- return
- }
-
- const px = Math.min(Math.max(x, left), right)
- const py = Math.min(Math.max(y, top), bottom)
- card.style.setProperty('--catalog-x', `${((px - left) / width) * 100}%`)
- card.style.setProperty('--catalog-y', `${((py - top) / height) * 100}%`)
- card.style.setProperty('--catalog-near', Math.max(0, 1 - Math.hypot(x - px, y - py) / FALLOFF_PX).toFixed(3))
- })
- }
-
- const schedule = () => void (frame ||= requestAnimationFrame(paint))
-
- const move = (event: PointerEvent) => {
- x = event.clientX
- y = event.clientY
- schedule()
- }
-
- // Scroll re-aims only once the pointer has been seen; until then cards rest.
- const scroll = () => void (x || y ? schedule() : undefined)
-
- root.addEventListener('pointermove', move)
- root.addEventListener('scroll', scroll, true)
-
- return () => {
- cancelAnimationFrame(frame)
- root.removeEventListener('pointermove', move)
- root.removeEventListener('scroll', scroll, true)
- }
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-query.ts b/apps/desktop/src/app/capabilities/catalog/catalog-query.ts
deleted file mode 100644
index 95d37be7215..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog-query.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-import { PLUGIN_CATEGORIES, PLUGIN_CATEGORY_ORDER, sortCatalogPlugins } from '@hermes/shared'
-
-import type { CatalogEntry, CatalogKind } from './catalog-data'
-import type { FacetRow } from './catalog-filters'
-
-export type CatalogSort = 'discover' | 'stars' | 'newest' | 'updated' | 'name'
-
-export interface CatalogFacets {
- sources: string[]
- categories: string[]
- tags: string[]
- installedOnly: boolean
-}
-
-export const EMPTY_FACETS: CatalogFacets = { sources: [], categories: [], tags: [], installedOnly: false }
-
-export const catalogSources = (entries: CatalogEntry[]) => [...new Set(entries.map(entry => entry.source))]
-
-/** Category facet rows with counts; plugins follow the shared taxonomy order. */
-export function catalogCategories(entries: CatalogEntry[], kind: CatalogKind) {
- const values = new Map<string, { label: string; count: number }>()
-
- for (const entry of entries) {
- values.set(entry.category, { label: entry.categoryLabel, count: (values.get(entry.category)?.count ?? 0) + 1 })
- }
-
- if (kind === 'plugins') {
- return PLUGIN_CATEGORY_ORDER.filter(key => values.has(key)).map(
- key => [key, { ...values.get(key)!, label: PLUGIN_CATEGORIES[key].label }] as const
- )
- }
-
- return [...values].sort((a, b) => b[1].count - a[1].count)
-}
-
-/** The most common tags plus whatever is selected; search covers the long tail. */
-export function catalogTags(entries: CatalogEntry[], selected: string[], limit: number): FacetRow[] {
- const counts = new Map<string, number>()
-
- for (const entry of entries) {
- for (const value of new Set(entry.tags)) {
- counts.set(value, (counts.get(value) ?? 0) + 1)
- }
- }
-
- const ranked = [...counts].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]))
- const shown = new Set([...ranked.slice(0, limit).map(([value]) => value), ...selected])
-
- return ranked.filter(([value]) => shown.has(value)).map(([value, count]) => ({ value, label: value, count }))
-}
-
-/** Facets combine as AND across groups and OR within one. */
-export function filterCatalog(
- entries: CatalogEntry[],
- facets: CatalogFacets,
- query: string,
- isInstalled: (entry: CatalogEntry) => boolean
-) {
- const { sources, categories, tags, installedOnly } = facets
-
- return entries.filter(
- entry =>
- (!sources.length || sources.includes(entry.source)) &&
- (!categories.length || categories.includes(entry.category)) &&
- (!tags.length || tags.some(tag => entry.tags.includes(tag))) &&
- (!installedOnly || isInstalled(entry)) &&
- (!query || entry.search.includes(query))
- )
-}
-
-/** Returns a new array; `discover` keeps the feed's curated order. */
-export function sortCatalog(entries: CatalogEntry[], sort: CatalogSort, kind: CatalogKind) {
- if (sort === 'discover') {
- return entries
- }
-
- if (kind === 'plugins' && sort !== 'name') {
- return sortCatalogPlugins(entries, sort)
- }
-
- if (sort === 'name') {
- return [...entries].sort((a, b) => a.name.localeCompare(b.name))
- }
-
- if (sort === 'stars') {
- return [...entries].sort((a, b) => (b.stars ?? -1) - (a.stars ?? -1) || a.name.localeCompare(b.name))
- }
-
- const field = sort === 'newest' ? 'addedAt' : 'updatedAt'
- const time = new Map(entries.map(entry => [entry.id, Date.parse(entry[field] ?? '') || 0]))
-
- return [...entries].sort((a, b) => time.get(b.id)! - time.get(a.id)! || a.name.localeCompare(b.name))
-}
-
-/** First `limit` entries sharing a category or tag with `entry`; stops early on large feeds. */
-export function relatedEntries(entries: CatalogEntry[], entry: CatalogEntry, limit: number) {
- const matches: CatalogEntry[] = []
-
- for (const candidate of entries) {
- if (matches.length === limit) {
- break
- }
-
- if (
- candidate.id !== entry.id &&
- (candidate.category === entry.category || candidate.tags.some(tag => entry.tags.includes(tag)))
- ) {
- matches.push(candidate)
- }
- }
-
- return matches
-}
-
-export function catalogSortOptions(entries: CatalogEntry[], kind: CatalogKind, labels: Record<CatalogSort, string>) {
- const available: Record<CatalogSort, boolean> = {
- discover: kind === 'skills',
- stars: entries.some(entry => entry.stars !== null),
- newest: entries.some(entry => entry.addedAt),
- updated: entries.some(entry => entry.updatedAt),
- name: kind === 'skills'
- }
-
- return (Object.keys(available) as CatalogSort[])
- .filter(value => available[value])
- .map(value => ({ value, label: labels[value] }))
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog.css b/apps/desktop/src/app/capabilities/catalog/catalog.css
deleted file mode 100644
index 1fd89e25886..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/catalog.css
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Registered so the gradient can glide instead of jump. Written per card by
- `trackCatalogPointer`: x/y is the pointer clamped to the card, near is 0–1. */
-@property --catalog-x {
- syntax: '<percentage>';
- inherits: false;
- initial-value: 0%;
-}
-
-@property --catalog-y {
- syntax: '<percentage>';
- inherits: false;
- initial-value: 0%;
-}
-
-@property --catalog-near {
- syntax: '<number>';
- inherits: false;
- initial-value: 0;
-}
-
-/* Each card carries one accent (`--catalog-accent`, set by class). Its gradient
- keeps one shape and strength and only its center drifts toward the pointer,
- onto it when on the card. Light surfaces show tint far more than dark ones,
- so light gets a softer wash from the bottom-left; `:root.dark` restores
- the stronger top-left glow. */
-[data-catalog-card] {
- /* How far the gradient leans from its rest point toward the pointer: all the
- way on the card itself, falling off fast with distance to the box. */
- --catalog-follow: calc(var(--catalog-near) * var(--catalog-near));
- --catalog-rest-x: 0%;
- --catalog-rest-y: 100%;
- --catalog-tint: 10%;
- --catalog-edge: 20%;
- border-color: color-mix(in srgb, var(--catalog-accent) var(--catalog-edge), var(--ui-stroke-tertiary));
- background:
- radial-gradient(
- 140% 100% at calc(var(--catalog-rest-x) + (var(--catalog-x) - var(--catalog-rest-x)) * var(--catalog-follow))
- calc(var(--catalog-rest-y) + (var(--catalog-y) - var(--catalog-rest-y)) * var(--catalog-follow)),
- color-mix(in srgb, var(--catalog-accent) var(--catalog-tint), transparent),
- transparent 70%
- )
- var(--ui-chat-bubble-background);
- transition:
- border-color 0.1s ease,
- box-shadow 0.1s ease,
- opacity 0.15s ease,
- filter 0.15s ease,
- --catalog-x 5s cubic-bezier(0.2, 0.8, 0.2, 1),
- --catalog-y 5s cubic-bezier(0.2, 0.8, 0.2, 1),
- --catalog-near 5s ease;
-}
-
-:root.dark [data-catalog-card] {
- --catalog-rest-x: 0%;
- --catalog-rest-y: 0%;
- --catalog-tint: 18%;
- --catalog-edge: 24%;
-}
-
-[data-catalog-card]:hover {
- /* Matches the selected-option treatment (`border-primary ring-2 ring-primary/20`). */
- border-color: var(--color-primary);
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 20%, transparent);
-}
-
-/* Uniform alternative to Masonry: same column tracks, cards in a row share one
- height. Rows start at a complete text card (4-line description, two chip
- rows, dates ≈ 250px) and grow for a card with a hero image, so image and
- description always show in full. */
-.catalog-grid {
- display: grid;
- grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
- grid-auto-rows: minmax(16rem, auto);
- gap: calc(var(--spacing) * 3);
-}
-
-/* Store-browsing feel: hovering one card dims its siblings in the same group. */
-[data-catalog-hover-group]:has([data-catalog-card]:hover) [data-catalog-card]:not(:hover) {
- opacity: 1;
- filter: saturate(0.8);
-}
-
-@media (prefers-reduced-motion: reduce) {
- [data-catalog-card] {
- transition: border-color 0.1s ease, box-shadow 0.1s ease, opacity 0.15s ease, filter 0.15s ease;
- }
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/skill-catalog.tsx b/apps/desktop/src/app/capabilities/catalog/skill-catalog.tsx
deleted file mode 100644
index 8075374414c..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/skill-catalog.tsx
+++ /dev/null
@@ -1,321 +0,0 @@
-import { useQuery } from '@tanstack/react-query'
-import { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'
-
-import { capabilityScoped } from '@/api/client'
-import { Loader } from '@/components/ui/loader'
-import { getOfficialSkills, type ProfileScope, profileScopeKey } from '@/hermes'
-import { useI18n } from '@/i18n'
-import { HUB_SOURCES_KEY, installHubSkill, notifyHubActionFailed, OFFICIAL_SKILLS_KEY } from '@/store/hub-actions'
-import { notify } from '@/store/notifications'
-import type { SkillHubSourcesResponse, SkillInfo } from '@/types/hermes'
-
-import { catalogSourceFor } from '../skills/skill-provenance'
-
-import { CatalogAlert } from './catalog-alert'
-import { CatalogBrowser } from './catalog-browser'
-import { type CatalogEntry, parseCatalog } from './catalog-data'
-
-interface SkillCatalogProps {
- skills: SkillInfo[]
- profile: ProfileScope
- query?: string
- onQueryChange?: (value: string) => void
- actions?: ReactNode
- installedPending?: boolean
- notice?: ReactNode
- renderInstalledDetail: (skill: SkillInfo) => ReactNode
- renderInstalledAction?: (skill: SkillInfo) => ReactNode
-}
-
-/** Public discovery and the profile's local skills share one browser. Management
- * stays in SkillsTab; catalog install actions have exactly one owner here. */
-export function SkillCatalog(props: SkillCatalogProps) {
- return <ScopedSkillCatalog key={profileScopeKey(props.profile)} {...props} />
-}
-
-function ScopedSkillCatalog({
- skills,
- profile,
- query,
- onQueryChange,
- actions,
- installedPending,
- notice,
- renderInstalledDetail,
- renderInstalledAction
-}: SkillCatalogProps) {
- const { t } = useI18n()
- const h = t.skills.hub
- const mounted = useRef(true)
- const pending = useRef(new Set<string>())
- const [installing, setInstalling] = useState<ReadonlySet<string>>(new Set())
-
- // eslint-disable-next-line no-restricted-syntax -- lifecycle guard drops stale async completions; it does not mirror an atom
- useEffect(() => {
- mounted.current = true
-
- return () => {
- mounted.current = false
- }
- }, [])
-
- const {
- data: officialData,
- error: officialError,
- refetch: refreshOfficial
- } = useQuery({
- queryKey: [...OFFICIAL_SKILLS_KEY, profileScopeKey(profile)],
- queryFn: () => getOfficialSkills(profile),
- staleTime: 60_000,
- retry: false
- })
-
- const hasHubSkills = skills.some(skill => skill.provenance === 'hub')
-
- const {
- data: hubData,
- isPending: hubPending,
- error: hubError,
- refetch: refreshHub
- } = useQuery({
- queryKey: [...HUB_SOURCES_KEY, profileScopeKey(profile)],
- // SkillInfo has provenance, not a source identifier. Read the installed
- // lock map rather than guessing identity from a community skill's name.
- // The older getSkillHubSources helper cannot carry a connection pin.
- queryFn: () =>
- window.hermesDesktop.api<SkillHubSourcesResponse>({
- ...capabilityScoped(profile),
- path: '/api/skills/hub/sources',
- timeoutMs: 45_000
- }),
- enabled: hasHubSkills,
- staleTime: 60_000,
- retry: false
- })
-
- const catalog = useMemo(() => {
- const skillsById = new Map<string, SkillInfo>()
- const skillsByName = new Map(skills.map(skill => [skill.name, skill]))
- const installedByName = new Map<string, CatalogEntry>()
- const installedByIdentifier = new Map<string, CatalogEntry>()
- const installedIdentifiers = new Set(Object.keys(hubData?.installed ?? {}))
-
- const localEntries = parseCatalog(
- 'skills',
- skills.map(skill => ({
- name: skill.name,
- description: skill.description,
- category: skill.category,
- source: catalogSourceFor(skill.provenance)
- }))
- ).map(entry => {
- const skill = skillsByName.get(entry.name)!
- const installed = { ...entry, id: `installed:${skill.name}`, installIdentifier: null }
- skillsById.set(installed.id, skill)
- installedByName.set(skill.name, installed)
-
- return installed
- })
-
- for (const [identifier, record] of Object.entries(hubData?.installed ?? {})) {
- const installed = record.name ? installedByName.get(record.name) : undefined
-
- if (installed && skillsById.get(installed.id)?.provenance === 'hub') {
- installedByIdentifier.set(identifier, installed)
- }
- }
-
- const official = officialData?.skills ?? []
-
- const officialEntries = parseCatalog(
- 'skills',
- official.map(skill => ({
- ...skill,
- source: 'optional',
- installIdentifier: skill.identifier
- }))
- )
-
- const officialByIdentifier = new Map(officialEntries.map(entry => [entry.identifier, entry]))
-
- for (const skill of official) {
- if (!skill.installed) {
- continue
- }
-
- installedIdentifiers.add(skill.identifier)
- const installed = installedByName.get(skill.name)
-
- if (installed && skillsById.get(installed.id)?.provenance === 'hub') {
- installedByIdentifier.set(skill.identifier, installed)
- }
- }
-
- const officialFor = (entry: CatalogEntry) => {
- if (entry.source !== 'optional') {
- return undefined
- }
-
- const identifier = entry.installIdentifier ?? entry.identifier
- const exact = officialByIdentifier.get(identifier)
-
- if (exact) {
- return exact
- }
-
- if (identifier !== entry.name && identifier !== `official/${entry.name}`) {
- return undefined
- }
-
- // Old public snapshots omit optional identifiers. Only the official
- // optional namespace can use this fallback, never community lookalikes.
- return officialEntries.find(skill => skill.name === entry.name && skill.category === entry.category)
- }
-
- const matchInstalled = (entry: CatalogEntry): CatalogEntry | undefined => {
- const exact = installedByIdentifier.get(entry.installIdentifier ?? entry.identifier)
-
- if (exact) {
- return exact
- }
-
- if (entry.source === 'built-in') {
- const bundled = installedByName.get(entry.name)
-
- if (bundled && skillsById.get(bundled.id)?.provenance === 'bundled') {
- return bundled
- }
- }
-
- const optional = officialFor(entry)
-
- return optional ? (installedByIdentifier.get(optional.identifier) ?? optional) : undefined
- }
-
- // CatalogBrowser merges these supplemental rows with the public feed.
- // Optional rows remain available even offline / ahead of the snapshot;
- // membership here is NOT installation — isInstalled owns that decision.
- const entries = [
- ...localEntries,
- ...officialEntries.filter(entry => !installedByIdentifier.has(entry.identifier) && !skillsByName.has(entry.name))
- ]
-
- return { entries, skillsById, skillsByName, installedIdentifiers, matchInstalled, officialFor }
- }, [skills, hubData, officialData])
-
- // Skills install by name, so a same-named entry can never be added beside the installed one.
- const isInstalled = useCallback(
- (entry: CatalogEntry) => {
- if (catalog.skillsById.has(entry.id) || catalog.skillsByName.has(entry.name)) {
- return true
- }
-
- const matched = catalog.matchInstalled(entry)
-
- if (matched && catalog.skillsById.has(matched.id)) {
- return true
- }
-
- const optional = catalog.officialFor(entry)
-
- return catalog.installedIdentifiers.has(optional?.identifier ?? entry.installIdentifier ?? entry.identifier)
- },
- [catalog]
- )
-
- // The name guarantee above only holds for first-party namespaces, where a
- // shared name is the same skill. Community feeds carry distinct skills that
- // reuse popular names, so a community row whose name is taken by an installed
- // skill is neither that skill nor installable beside it — hide it instead of
- // showing it as installed. Rows already merged into an installed one (their
- // id is the installed row's) stay visible.
- const isSuperseded = useCallback(
- (entry: CatalogEntry) =>
- entry.source !== 'official' && !entry.id.startsWith('installed:') && catalog.skillsByName.has(entry.name),
- [catalog]
- )
-
- const installIdentifier = (entry: CatalogEntry) => catalog.officialFor(entry)?.identifier ?? entry.installIdentifier
-
- const identityPending = hasHubSkills && (hubPending || Boolean(hubError))
-
- const install = (entry: CatalogEntry) => {
- const identifier = installIdentifier(entry)
-
- if (installedPending || identityPending || !identifier || isInstalled(entry) || pending.current.has(identifier)) {
- return
- }
-
- pending.current.add(identifier)
- setInstalling(new Set(pending.current))
- notify({ kind: 'success', title: h.installStarted(entry.name), message: h.actionLog })
- void installHubSkill(identifier, profile)
- .catch(err => {
- if (mounted.current) {
- notifyHubActionFailed(err, h.actionFailed, entry.name, profile)
- }
- })
- .finally(() => {
- pending.current.delete(identifier)
-
- if (mounted.current) {
- setInstalling(new Set(pending.current))
- }
- })
- }
-
- return (
- <CatalogBrowser
- actions={actions}
- installedEntries={catalog.entries}
- installedPending={installedPending || identityPending}
- isInstalled={isInstalled}
- isInstalling={entry => installing.has(installIdentifier(entry) ?? '')}
- isSuperseded={isSuperseded}
- kind="skills"
- matchInstalled={catalog.matchInstalled}
- notice={
- <>
- {notice}
- {(officialError || hubError) && (
- <CatalogAlert
- onRetry={() => {
- if (officialError) {
- void refreshOfficial()
- }
-
- if (hubError) {
- void refreshHub()
- }
- }}
- retryLabel={t.skills.refresh}
- title={t.skills.skillsLoadFailed}
- >
- {(hubError ?? officialError)?.message}
- </CatalogAlert>
- )}
- {hasHubSkills && hubPending && !installedPending && !notice && (
- <Loader
- className="mx-auto my-2 size-6 text-(--ui-text-tertiary)"
- label={t.skills.loading}
- type="rose-curve"
- />
- )}
- </>
- }
- onInstall={install}
- onQueryChange={onQueryChange}
- query={query}
- renderInstalledAction={entry => {
- const skill = catalog.skillsById.get(entry.id)
-
- return skill && renderInstalledAction ? renderInstalledAction(skill) : null
- }}
- renderInstalledDetail={entry => {
- const skill = catalog.skillsById.get(entry.id)
-
- return skill ? renderInstalledDetail(skill) : null
- }}
- />
- )
-}
diff --git a/apps/desktop/src/app/capabilities/catalog/store.ts b/apps/desktop/src/app/capabilities/catalog/store.ts
deleted file mode 100644
index 4581228039b..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/store.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { Codecs, persistentAtom } from '@/lib/persisted'
-
-// One browsing layout across Skills and Plugins; Installed keeps its own list.
-export const $catalogCardView = persistentAtom('hermes.desktop.capabilities.catalogCardView', true, Codecs.bool)
diff --git a/apps/desktop/src/app/capabilities/catalog/update-skills-button.tsx b/apps/desktop/src/app/capabilities/catalog/update-skills-button.tsx
deleted file mode 100644
index d57f281b534..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/update-skills-button.tsx
+++ /dev/null
@@ -1,26 +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/app/capabilities/catalog/use-catalog-filters.ts b/apps/desktop/src/app/capabilities/catalog/use-catalog-filters.ts
deleted file mode 100644
index e818666e0eb..00000000000
--- a/apps/desktop/src/app/capabilities/catalog/use-catalog-filters.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { useState } from 'react'
-
-import type { CatalogKind } from './catalog-data'
-import { type CatalogFacets, type CatalogSort, EMPTY_FACETS } from './catalog-query'
-
-type ListFacet = 'sources' | 'categories' | 'tags'
-
-const toggled = (list: string[], value: string) =>
- list.includes(value) ? list.filter(item => item !== value) : [...list, value]
-
-/** Rail state for one catalog. `onChange` runs after every change so the
- * browser can drop paging and selection that no longer apply. */
-export function useCatalogFilters(kind: CatalogKind, onChange: () => void) {
- const [facets, setFacets] = useState(EMPTY_FACETS)
- const [sort, setSortState] = useState<CatalogSort>(kind === 'plugins' ? 'stars' : 'discover')
-
- const update = (next: (current: CatalogFacets) => CatalogFacets) => {
- setFacets(next)
- onChange()
- }
-
- // `null` clears the facet (its "All" row).
- const toggle = (facet: ListFacet) => (value: string | null) =>
- update(current => ({ ...current, [facet]: value === null ? [] : toggled(current[facet], value) }))
-
- return {
- facets,
- sort,
- setSort: (value: CatalogSort) => {
- setSortState(value)
- onChange()
- },
- toggleSource: toggle('sources'),
- toggleCategory: toggle('categories'),
- toggleTag: toggle('tags'),
- toggleInstalled: () => update(current => ({ ...current, installedOnly: !current.installedOnly })),
- // Cards and "See all" drill into one category rather than toggling it.
- chooseCategory: (value: string) => update(current => ({ ...current, categories: [value], tags: [] })),
- clear: () => update(() => EMPTY_FACETS)
- }
-}
diff --git a/apps/desktop/src/app/capabilities/index.test.tsx b/apps/desktop/src/app/capabilities/index.test.tsx
index bcc56565bdc..20a16c623a4 100644
--- a/apps/desktop/src/app/capabilities/index.test.tsx
+++ b/apps/desktop/src/app/capabilities/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/catalog-data'
-import { $catalogCardView } from './catalog/store'
-
const getSkills = vi.fn()
const getToolsets = vi.fn()
const setSkillEnabled = vi.fn()
@@ -100,7 +97,6 @@ async function renderSkills() {
}
beforeEach(() => {
- $catalogCardView.set(true)
getSkills.mockResolvedValue([])
getToolsets.mockResolvedValue([toolset()])
setToolsetEnabled.mockResolvedValue({ ok: true, name: 'web', enabled: false })
@@ -115,7 +111,6 @@ beforeEach(() => {
// Single profile by default → the scope selector stays hidden (>1 gate),
// so existing tests see unchanged single-profile behavior.
getProfiles.mockResolvedValue({ profiles: [{ name: 'default', is_default: true }] })
- queryClient.setQueryData(['public-catalog', 'skills'], [])
})
afterEach(() => {
@@ -214,9 +209,8 @@ describe('CapabilitiesView toolset management', { timeout: 60_000 }, () => {
)
})
- // The selector renders on the Skills tab too (Capabilities-wide), above the catalog's sort select.
- await waitFor(() => expect(screen.getAllByRole('combobox')).toHaveLength(2))
- const [trigger] = screen.getAllByRole('combobox')
+ // The selector renders on the Skills tab too (Capabilities-wide).
+ const trigger = await screen.findByRole('combobox')
await act(async () => {
fireEvent.click(trigger)
})
@@ -236,8 +230,7 @@ describe('CapabilitiesView toolset management', { timeout: 60_000 }, () => {
await waitFor(() => expect(setSkillEnabled).toHaveBeenCalledWith('web-research', false, 'researcher'))
})
- it('shows the FULL skill body in the detail pane, not just the description or raw frontmatter', async () => {
- $catalogCardView.set(false)
+ it('shows the FULL skill in the detail pane — frontmatter metadata + body', async () => {
getSkills.mockResolvedValue([
{
name: 'web-research',
@@ -259,79 +252,74 @@ describe('CapabilitiesView toolset management', { timeout: 60_000 }, () => {
)
})
+ // Frontmatter renders as metadata rows, the body as full text — not just
+ // the one-line description.
await waitFor(() => expect(getSkillContent).toHaveBeenCalled())
expect(getSkillContent.mock.calls[0][0]).toBe('web-research')
+ expect(await screen.findByText('version')).toBeTruthy()
+ expect(await screen.findByText('1.2.0')).toBeTruthy()
expect(await screen.findByText(/Deep research steps/)).toBeTruthy()
- expect(screen.queryByText(/version: 1\.2\.0/)).toBeNull()
})
- it('keeps installed skills on their toggle and installs new cards into the pinned remote profile', async () => {
- const { installHubSkill } = await import('@/store/hub-actions')
- getSkills.mockResolvedValue([
- { name: 'web-research', description: 'Research', enabled: true, category: 'research' }
- ])
- queryClient.setQueryData(
- ['public-catalog', 'skills'],
- parseCatalog('skills', [
- { name: 'web-research', source: 'official', identifier: 'official/research/web-research' },
- { name: 'gif-search', source: 'official', identifier: 'official/gifs/gif-search' }
- ])
- )
+ it('hub picker refuses to reinstall an already-installed skill', async () => {
+ const { notify } = await import('@/store/notifications')
+ const { EmbeddedHubPicker } = await import('./skills/embedded-hub-picker')
- render(
- <QueryClientProvider client={queryClient}>
- <MemoryRouter>
- <CapabilitiesView embedded fixedConnection="homelab" fixedProfile="inbox-bot" />
- </MemoryRouter>
- </QueryClientProvider>
- )
+ render(<EmbeddedHubPicker installedNames={new Set(['web-research'])} profile={null} />)
+
+ // The picker is expanded by default — the hub iframe is live on mount.
+ expect(document.querySelector('iframe')).toBeTruthy()
+
+ await act(async () => {
+ window.dispatchEvent(
+ new MessageEvent('message', {
+ data: { type: 'hermes-skill-pick', name: 'web-research', identifier: 'web-research' },
+ origin: 'https://hermes-agent.nousresearch.com'
+ })
+ )
+ })
- await screen.findByRole('switch', { name: 'web-research' })
- expect(screen.getByRole<HTMLButtonElement>('switch', { name: 'Added web-research' }).disabled).toBe(true)
- expect(screen.queryByRole('switch', { name: 'Add web-research' })).toBeNull()
- const available = screen.getByRole('button', { name: 'gif-search' }).closest('article')!
- fireEvent.click(within(available).getByRole('switch', { name: 'Add gif-search' }))
+ // Refused with an informational toast, no install action spawned.
await waitFor(() =>
- expect(installHubSkill).toHaveBeenCalledExactlyOnceWith('official/gifs/gif-search', {
- connectionId: 'homelab',
- profile: 'inbox-bot'
- })
+ expect(vi.mocked(notify)).toHaveBeenCalledWith(
+ expect.objectContaining({ title: expect.stringContaining('web-research') })
+ )
)
- expect(document.querySelector('iframe')).toBeNull()
})
- it('fetches the public catalog once across remounts and keeps one search input', async () => {
- queryClient.clear()
-
- const fetch = vi.fn().mockResolvedValue({
- ok: true,
- json: async () => [{ name: 'example', source: 'official', identifier: 'official/example' }]
- })
-
- vi.stubGlobal('fetch', fetch)
+ 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(document.querySelector('iframe')).toBeNull()
+ cleanup()
- const view = () =>
+ // 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}>
- <MemoryRouter>
- <CapabilitiesView embedded fixedProfile="default" />
+ <MemoryRouter initialEntries={['/capabilities']}>
+ <CapabilitiesView embedded />
</MemoryRouter>
</QueryClientProvider>
)
+ })
- try {
- const first = view()
- await screen.findByRole('button', { name: 'example' })
- expect(fetch).toHaveBeenCalledTimes(1)
- first.unmount()
- view()
- await screen.findByRole('button', { name: 'example' })
- expect(fetch).toHaveBeenCalledTimes(1)
- expect(screen.getAllByRole('textbox', { name: 'Search skills' })).toHaveLength(1)
- expect(document.querySelector('iframe')).toBeNull()
- } finally {
- vi.unstubAllGlobals()
- }
+ 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 () => {
@@ -433,11 +421,11 @@ describe('CapabilitiesView toolset management', { timeout: 60_000 }, () => {
}
})
- it('lists the built-in optional-skills catalog with Add switches that route through the hub pipeline', async () => {
- // Official optional skills merge into the same catalog as installed ones;
- // an uninstalled row carries an Add switch that routes through the hub
- // action pipeline scoped to the Capabilities profile. A name collision with
- // an installed skill keeps the installed toggle, never a second Add.
+ 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([
@@ -489,10 +477,15 @@ describe('CapabilitiesView toolset management', { timeout: 60_000 }, () => {
)
})
- const install = await screen.findByRole('switch', { name: 'Add gif-search' })
+ // 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('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()
- expect(screen.queryByRole('switch', { name: 'Add web-research' })).toBeNull()
- expect(screen.getByRole<HTMLButtonElement>('switch', { name: 'Added ascii-art' }).disabled).toBe(true)
+ const install = screen.getByRole('button', { name: 'Install' })
await act(async () => {
fireEvent.click(install)
@@ -502,42 +495,4 @@ describe('CapabilitiesView toolset management', { timeout: 60_000 }, () => {
expect(vi.mocked(installHubSkill)).toHaveBeenCalledWith('official/gifs/gif-search', expect.anything())
)
})
-
- it('drops community feed rows that only share a name with an installed skill', async () => {
- // Installs are name-keyed, so a community lookalike of an installed skill
- // can neither be added beside it nor is it the installed skill itself —
- // it must not surface as a second "installed" row under the same name.
- getSkills.mockResolvedValue([
- {
- name: 'docx',
- description: 'Bundled document tools',
- category: 'documents',
- enabled: true,
- usage: 0,
- provenance: 'bundled'
- }
- ])
- queryClient.setQueryData(
- ['public-catalog', 'skills'],
- parseCatalog('skills', [
- { name: 'docx', source: 'ClawHub', identifier: 'wordpro' },
- { name: 'gif-search', source: 'ClawHub', identifier: 'gif-raccoon' }
- ])
- )
-
- await act(async () => {
- render(
- <QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/capabilities?tab=skills']}>
- <CapabilitiesView />
- </MemoryRouter>
- </QueryClientProvider>
- )
- })
-
- // The feed settles first; then only the installed row keeps the name,
- // while the distinct community skill stays installable.
- await screen.findByRole('switch', { name: 'Add gif-search' })
- expect(screen.getAllByRole('button', { name: 'docx' })).toHaveLength(1)
- })
})
diff --git a/apps/desktop/src/app/capabilities/index.tsx b/apps/desktop/src/app/capabilities/index.tsx
index 54a9e41fd77..d784218db2e 100644
--- a/apps/desktop/src/app/capabilities/index.tsx
+++ b/apps/desktop/src/app/capabilities/index.tsx
@@ -1,5 +1,5 @@
import type * as React from 'react'
-import { useCallback, useEffect, useMemo, useState } from 'react'
+import { useCallback, useMemo, useState } from 'react'
import { PageLoader } from '@/components/page-loader'
import { Button } from '@/components/ui/button'
@@ -16,10 +16,10 @@ import { PanelEmpty } from '../overlays/panel'
import { PageSearchShell } from '../page-search-shell'
import type { SetStatusbarItemGroup } from '../shell/statusbar-controls'
-import { prefetchCatalogWhenIdle } from './catalog/catalog-data'
import { ConnectorsTab } from './connectors/connectors-tab'
import { PluginsTab } from './plugins/plugins-tab'
import { CapabilityScopeSelector, useCapabilityScope } from './scope-selector'
+import { EmbeddedHubPicker } from './skills/embedded-hub-picker'
import { SKILLS_QUERY_KEY, skillSearchTerms, useSkillsQuery } from './skills/skills-data'
import { SkillsTab } from './skills/skills-tab'
import { refreshToolCalls } from './toolsets/tool-calls'
@@ -72,12 +72,20 @@ export function CapabilitiesView({
const [query, setQuery] = useState('')
+ // Keep the docs iframe alive after the first Skills visit.
+ const [hubMounted, setHubMounted] = useState(mode === 'skills')
+
+ if (mode === 'skills' && !hubMounted) {
+ setHubMounted(true)
+ }
+
const scope = useCapabilityScope({ fixedConnection, fixedProfile })
// The two installed lists the tab pills count. They are fetched here, as a
// pair, because the counts stay live for the tab the user is NOT on.
const { data: skills, isError: skillsFailed, error: skillsError } = useSkillsQuery(scope.profile)
const { data: toolsets, isError: toolsetsFailed } = useToolsetsQuery(scope.profile)
+ const installedSkillNames = useMemo(() => new Set((skills ?? []).map(skill => skill.name)), [skills])
const refreshCapabilities = useCallback(async () => {
await Promise.all([
@@ -93,10 +101,6 @@ export function CapabilitiesView({
useRefreshHotkey(refreshCapabilities)
- // Plugins is small enough to warm from any tab. Skills (~100k rows) only
- // loads when asked for: an idle parse of it would still block the page.
- useEffect(() => (mode === 'plugins' ? undefined : prefetchCatalogWhenIdle('plugins')), [mode])
-
// Rotating placeholder nudges from the user's own data — teach that search
// understands categories and tool names, not just titles.
const searchHints = useMemo(() => {
@@ -112,7 +116,7 @@ export function CapabilitiesView({
}, [mode, skills, t, toolsets])
// MCP and Plugins load independently of the installed Skills/Tools lists.
- const gated = mode === 'toolsets'
+ const gated = mode === 'toolsets' || mode === 'skills'
const pending = gated && !(skills && toolsets)
const loadGate = !pending ? null : skillsFailed || toolsetsFailed ? (
@@ -141,23 +145,19 @@ export function CapabilitiesView({
profile={scope.profile}
/>
),
- // Agent plugins for the scoped profile and app-level desktop plugins.
+ // Agent plugins for the scoped profile (selector in the section header),
+ // app-level desktop plugins, and the docs catalog picker underneath.
plugins: () => (
<PluginsTab
key={`plugins-${scope.key}`}
- onQueryChange={setQuery}
profile={scope.profile}
- query={query}
scopeLabel={scope.label}
scopeSelector={scope.options.length > 1 ? <CapabilityScopeSelector compact scope={scope} /> : undefined}
/>
),
skills: () => (
<SkillsTab
- installedError={skillsError}
- installedPending={!skills || skillsFailed}
key={`skills-${scope.key}`}
- onQueryChange={setQuery}
onRefresh={() => void refreshCapabilities()}
profile={scope.profile}
query={query}
@@ -175,16 +175,10 @@ export function CapabilitiesView({
activeTab={mode}
onSearchChange={setQuery}
onTabChange={id => setMode(id as CapabilityMode)}
- // Catalogs keep search beside their results; Connectors owns its field too.
- searchHidden={mode !== 'toolsets'}
+ // The Connectors directory owns its search field; plugins has its own list.
+ searchHidden={mode === 'connectors' || 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 },
@@ -195,7 +189,18 @@ export function CapabilitiesView({
>
<div className="flex h-full flex-col">
{mode !== 'plugins' && <CapabilityScopeSelector scope={scope} />}
- <div className="flex min-h-0 flex-1 flex-col">{loadGate ?? tabContent[mode]()}</div>
+ <div className="flex min-h-0 flex-1 flex-col">
+ <div className={mode === 'skills' ? 'min-h-40 flex-1 overflow-hidden' : 'min-h-0 flex-1'}>
+ {loadGate ?? tabContent[mode]()}
+ </div>
+ {hubMounted && (
+ <EmbeddedHubPicker
+ hidden={mode !== 'skills'}
+ installedNames={installedSkillNames}
+ profile={scope.profile}
+ />
+ )}
+ </div>
</div>
</PageSearchShell>
)
diff --git a/apps/desktop/src/app/capabilities/plugins/plugins-tab.test.tsx b/apps/desktop/src/app/capabilities/plugins/plugins-tab.test.tsx
index 8373e206012..0232edbdc0d 100644
--- a/apps/desktop/src/app/capabilities/plugins/plugins-tab.test.tsx
+++ b/apps/desktop/src/app/capabilities/plugins/plugins-tab.test.tsx
@@ -1,64 +1,18 @@
-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 { MemoryRouter, useLocation } from 'react-router'
+import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { $pluginDecisions, $pluginRecords, dropPlugin, patchPlugin, publishPlugin } from '@/contrib/plugins-store'
import { queryClient } from '@/lib/query-client'
-import { $agentPlugins, $agentPluginsStatus, type AgentPluginRow } from '@/store/agent-plugins'
+import { $agentPlugins, $agentPluginsStatus } from '@/store/agent-plugins'
import { $confirmRequest, settleConfirm } from '@/store/confirm'
import { $notifications } from '@/store/notifications'
+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 { parseCatalog } from '../catalog/catalog-data'
-import { $catalogCardView } from '../catalog/store'
-
import { PluginsTab } from './plugins-tab'
-const requestGateway = vi.fn(async (_method: string, _params?: Record<string, unknown>): Promise<unknown> => ({
- plugins: $agentPlugins.get()
-}))
-
-// The shell owns search; exercise the same controlled composition as CapabilitiesView.
-function PluginsHarness({ query: initialQuery, ...props }: ComponentProps<typeof PluginsTab>) {
- const [query, setQuery] = useState(initialQuery ?? '')
-
- return (
- <PageSearchShell onSearchChange={setQuery} searchHidden searchPlaceholder="Search plugins" searchValue={query}>
- <PluginsTab {...props} onQueryChange={setQuery} query={query} />
- </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((await screen.findAllByRole('button', { name }))[0])
- expect(screen.getAllByRole('heading', { name }).length).toBeGreaterThan(0)
-}
+const requestGateway = vi.fn(async () => ({ plugins: [] }))
const connectionFixture = {
baseUrl: 'http://localhost',
@@ -75,9 +29,6 @@ vi.mock('@/app/gateway/hooks/use-gateway-request', () => ({
}))
const uninstallDiskPlugin = vi.fn(async (_id: string) => ({ ok: true }))
-const setEnvVar = vi.fn(async (..._args: unknown[]) => ({}))
-
-vi.mock('@/api/config', () => ({ setEnvVar: (...args: unknown[]) => setEnvVar(...args) }))
vi.mock('@/contrib/runtime-loader', async importOriginal => ({
...(await importOriginal<Record<string, unknown>>()),
@@ -95,63 +46,23 @@ vi.mock('@/api/toolsets', async importOriginal => ({
setToolsetEnabled: (...args: unknown[]) => setToolsetEnabled(...(args as Parameters<typeof setToolsetEnabled>))
}))
-beforeEach(() => {
- $pluginRecords.set({})
- $agentPlugins.set([])
- $agentPluginsStatus.set('ready')
- $catalogCardView.set(false)
- seedCatalog([])
- closePluginInstallRequest()
- requestGateway.mockReset()
- requestGateway.mockImplementation(async () => ({ plugins: $agentPlugins.get() }))
- setEnvVar.mockClear()
- setToolsetEnabled.mockReset()
- setToolsetEnabled.mockResolvedValue({ enabled: true, name: 'kanban', ok: true })
- getToolsets.mockReset()
- getToolsets.mockResolvedValue([])
-})
-
-afterEach(() => {
- cleanup()
- settleConfirm(false)
- $connection.set(null)
- queryClient.clear()
- vi.unstubAllGlobals()
-})
-
describe('PluginsTab', () => {
- it('opens a non-first installed deep-link target from Browse and keeps that selection after consuming the link', async () => {
- Element.prototype.scrollIntoView = vi.fn()
- $agentPlugins.set(
- ['alpha', 'omega'].map(name => ({
- key: name,
- name,
- description: `${name} plugin`,
- source: 'git',
- status: 'enabled',
- version: '1'
- }))
- )
- seedCatalog()
-
- function Location() {
- return <output data-testid="route">{useLocation().search}</output>
- }
-
- render(
- <QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/capabilities?tab=plugins&plugin=omega']}>
- <Location />
- <PluginsHarness profile="workbot" query="nothing-matches" />
- </MemoryRouter>
- </QueryClientProvider>
- )
- await screen.findByRole('switch', { name: 'Agent: omega' })
- await waitFor(() => expect(screen.getByTestId('route').textContent).toBe('?tab=plugins'))
- expect(screen.getByRole<HTMLInputElement>('textbox', { name: 'Search plugins' }).value).toBe('')
- expect(screen.getByRole('switch', { name: 'Agent: omega' })).toBeTruthy()
- fireEvent.click(screen.getByRole('button', { name: 'alpha', pressed: false }))
- expect(screen.getByRole('switch', { name: 'Agent: alpha' })).toBeTruthy()
+ beforeEach(() => {
+ $pluginRecords.set({})
+ $agentPlugins.set([])
+ $agentPluginsStatus.set('ready')
+ closePluginInstallRequest()
+ requestGateway.mockClear()
+ setToolsetEnabled.mockReset()
+ setToolsetEnabled.mockResolvedValue({ enabled: true, name: 'kanban', ok: true })
+ getToolsets.mockReset()
+ getToolsets.mockResolvedValue([])
+ })
+
+ afterEach(() => {
+ cleanup()
+ $connection.set(null)
+ queryClient.clear()
})
it('renders declared server pills and the unavailable sentence under the description', () => {
@@ -174,7 +85,7 @@ describe('PluginsTab', () => {
}
])
- renderPlugins({ profile: 'workbot' })
+ render(<PluginsTab profile="workbot" />)
expect(screen.getByTestId('server-pill-ready-server')).toBeTruthy()
expect(screen.getByTestId('server-pill-setup-server')).toBeTruthy()
@@ -194,11 +105,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
@@ -218,7 +128,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()
@@ -238,7 +148,7 @@ describe('PluginsTab', () => {
}
])
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
const detail = within(screen.getByRole('row', { name: /^nous-prices/ }))
expect(detail.getByText('copying…')).toBeTruthy()
@@ -260,7 +170,7 @@ describe('PluginsTab', () => {
}
])
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
expect(screen.getAllByTestId(/^plugin-row-/)).toHaveLength(1)
expect(screen.getByText('Agent + Desktop')).toBeTruthy()
@@ -281,7 +191,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()
@@ -301,13 +211,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',
@@ -315,42 +225,49 @@ describe('PluginsTab', () => {
)
})
- it.each([false, true])('opens the scoped native install dialog from the selected entry (cards=%s)', async cards => {
- $catalogCardView.set(cards)
- 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('switch', { name: `Add ${weatherEntry.name}` }))
+ 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('shows installed plugins in list/detail mode and filters them through the parent search', () => {
- $pluginRecords.set({
- clock: { id: 'clock', name: 'Clock', kind: 'disk', status: 'loaded' },
- weather: { id: 'weather', name: 'Weather', kind: 'disk', status: 'loaded' }
- })
- renderPlugins({ profile: null })
-
- expect(screen.getByRole('button', { name: 'Clock', pressed: true })).toBeTruthy()
- expect(screen.getByRole('switch', { name: 'Desktop: Clock' })).toBeTruthy()
- fireEvent.click(screen.getByRole('button', { name: 'Weather', pressed: false }))
- expect(screen.getByRole('switch', { name: 'Desktop: Weather' })).toBeTruthy()
- expect(screen.queryByRole('dialog')).toBeNull()
+ 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'
+ })
+ )
- fireEvent.change(screen.getByRole('textbox', { name: 'Search plugins' }), { target: { value: 'Clock' } })
- expect(screen.queryByRole('button', { name: 'Weather', pressed: false })).toBeNull()
- expect(screen.getByRole('switch', { name: 'Desktop: Clock' })).toBeTruthy()
+ expect($pluginInstallRequest.get()).toBeNull()
})
it('toggles by canonical key through plugins.manage', async () => {
@@ -364,13 +281,12 @@ describe('PluginsTab', () => {
version: '0.20.0'
}
])
- requestGateway.mockImplementation(async (_method, params) =>
- params?.action === 'toggle'
- ? { ok: true, plugin: { key: 'image_gen/legacy', name: 'Legacy plugin', status: 'enabled' } }
- : { plugins: $agentPlugins.get() }
- )
+ requestGateway.mockResolvedValueOnce({
+ ok: true,
+ 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()
@@ -395,7 +311,7 @@ describe('PluginsTab', () => {
}
])
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
const toggle = screen.getByRole('switch', { name: 'Agent: Legacy plugin' })
@@ -406,25 +322,23 @@ describe('PluginsTab', () => {
expect(requestGateway).not.toHaveBeenCalledWith('plugins.manage', expect.objectContaining({ action: 'toggle' }))
})
- it('appends the selected subdir for multi-plugin repos without changing the 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('switch', { name: `Add ${entry.name}` }))
-
- 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')
})
})
@@ -440,7 +354,7 @@ describe('PluginsTab', () => {
kanban: { id: 'kanban', name: 'Kanban', kind: 'bundled', status: 'disabled' }
})
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
screen.getByRole('switch', { name: 'Desktop: Kanban' }).click()
@@ -457,7 +371,7 @@ describe('PluginsTab', () => {
kanban: { id: 'kanban', name: 'Kanban', kind: 'bundled', status: 'loaded' }
})
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
screen.getByRole('switch', { name: 'Desktop: Kanban' }).click()
@@ -496,7 +410,7 @@ describe('PluginsTab', () => {
setToolsetEnabled.mockRejectedValueOnce(new Error('HTTP 500'))
getToolsets.mockResolvedValueOnce(toolsetReads(false))
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
fireEvent.click(kanbanSwitch())
await waitFor(() => expect(notices('error')).toHaveLength(1))
await settled()
@@ -521,7 +435,7 @@ describe('PluginsTab', () => {
setToolsetEnabled.mockRejectedValueOnce(new Error('HTTP 500'))
getToolsets.mockResolvedValueOnce(toolsetReads(true))
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
fireEvent.click(kanbanSwitch())
await waitFor(() => expect(notices('error')).toHaveLength(1))
await settled()
@@ -544,7 +458,7 @@ describe('PluginsTab', () => {
setToolsetEnabled.mockRejectedValueOnce(new Error('Request timed out'))
getToolsets.mockResolvedValueOnce(toolsetReads(true))
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
fireEvent.click(kanbanSwitch())
await waitFor(() => expect(checked()).toBe('true'))
@@ -558,7 +472,7 @@ describe('PluginsTab', () => {
setToolsetEnabled.mockRejectedValueOnce(new Error('Request timed out'))
getToolsets.mockRejectedValueOnce(new Error('Request timed out'))
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
fireEvent.click(kanbanSwitch())
await waitFor(() => expect(notices('error')).toHaveLength(1))
await settled()
@@ -575,7 +489,7 @@ describe('PluginsTab', () => {
media: { id: 'media', name: 'Media Studio', kind: 'disk', status: 'loaded' }
})
- renderPlugins({ profile: 'workbot', scopeLabel: 'workbot' })
+ render(<PluginsTab profile="workbot" scopeLabel="workbot" />)
screen.getByRole('switch', { name: 'Desktop: Media Studio' }).click()
@@ -584,168 +498,34 @@ describe('PluginsTab', () => {
})
describe('PluginsTab catalog UX', () => {
- it('saves declared settings from the installed detail with values and secrets on their scoped routes', async () => {
- const row: AgentPluginRow = {
- name: 'demo-settings',
- key: 'category/demo-settings',
- description: 'Configurable plugin',
- source: 'git',
- status: 'enabled',
- version: '1',
- settings_schema: [
- { key: 'retries', label: 'Retries', type: 'number', description: '', required: true, value: 3 },
- { key: 'api_key', label: 'API key', type: 'secret', description: '', required: true, env: 'DEMO_API_KEY' }
- ]
- }
-
- $agentPlugins.set([row])
- requestGateway.mockImplementation(async (_method, params) =>
- params?.action === 'settings'
- ? {
- ok: true,
- plugin: {
- ...row,
- settings_schema: row.settings_schema!.map(field =>
- field.key === 'retries' ? { ...field, value: 9 } : field
- )
- }
- }
- : { plugins: $agentPlugins.get() }
- )
-
- const profile = { profile: 'workbot', connectionId: 'remote-work' }
-
- await act(async () => {
- renderPlugins({ profile })
- })
-
- fireEvent.click(screen.getByRole('button', { name: 'Settings: demo-settings' }))
- fireEvent.change(screen.getByRole('spinbutton', { name: 'Retries' }), { target: { value: '9' } })
- fireEvent.change(screen.getByLabelText('API key'), { target: { value: 'test-api-key' } })
- fireEvent.click(screen.getByRole('button', { name: 'Save settings' }))
-
- await waitFor(() => expect(setEnvVar).toHaveBeenCalledWith('DEMO_API_KEY', 'test-api-key', profile))
- await waitFor(() =>
- expect(requestGateway).toHaveBeenCalledWith('plugins.manage', {
- action: 'settings',
- key: row.key,
- values: { retries: 9 },
- profile: 'workbot'
- })
- )
- await waitFor(() => expect(screen.getByLabelText<HTMLInputElement>('API key').value).toBe(''))
- expect(screen.getByRole<HTMLButtonElement>('button', { name: 'Save settings' }).disabled).toBe(true)
+ beforeEach(() => {
+ $agentPlugins.set([])
+ $agentPluginsStatus.set('ready')
+ closePluginInstallRequest()
+ requestGateway.mockClear()
+ setPaneHeightOverride('capabilities-plugin-catalog', undefined)
})
- it('requires widening consent before retrying an update, and leaves a declined update untouched', async () => {
- $agentPlugins.set([
- {
- name: 'demo-weather',
- key: 'demo-weather',
- description: '',
- source: 'git',
- status: 'enabled',
- version: '1',
- catalog_sha: 'b'.repeat(40),
- update_available: true
- }
- ])
- requestGateway.mockImplementation(async (_method, params) => {
- if (params?.action !== 'update') {
- return { plugins: $agentPlugins.get() }
- }
-
- return params.accept_capabilities
- ? { ok: true, unchanged: false }
- : { consent_required: true, sha: 'b'.repeat(40), delta_lines: ['Tools: weather-alerts'] }
- })
- await act(async () => {
- renderPlugins({ profile: 'workbot' })
- })
- fireEvent.click(screen.getByRole('button', { name: `Update to ${'b'.repeat(8)}` }))
- await waitFor(() => expect($confirmRequest.get()?.description).toContain('Tools: weather-alerts'))
- expect($confirmRequest.get()?.title).toBe('demo-weather asks for more')
- await act(async () => {
- settleConfirm(false)
- })
- expect(requestGateway).not.toHaveBeenCalledWith(
- 'plugins.manage',
- expect.objectContaining({ accept_capabilities: true })
- )
- expect(screen.getByRole('button', { name: `Update to ${'b'.repeat(8)}` })).toBeTruthy()
-
- fireEvent.click(screen.getByRole('button', { name: `Update to ${'b'.repeat(8)}` }))
- await waitFor(() => expect($confirmRequest.get()).not.toBeNull())
- await act(async () => {
- settleConfirm(true)
- })
- expect(requestGateway).toHaveBeenCalledWith('plugins.manage', {
- action: 'update',
- name: 'demo-weather',
- profile: 'workbot',
- accept_capabilities: true
- })
- })
-
- it('fetches the catalog once, retaining parent search across selection and filters', async () => {
- queryClient.clear()
-
- const fetchCatalog = vi.fn().mockResolvedValue({
- ok: true,
- json: async () => [
- weatherEntry,
- { ...weatherEntry, name: 'garden-plugin', category: 'garden', description: 'Garden planning' }
- ]
- })
+ afterEach(cleanup)
- vi.stubGlobal('fetch', fetchCatalog)
- await act(async () => {
- renderPlugins({ profile: null })
- })
-
- await selectCatalogEntry('garden-plugin')
+ 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')
- const search = screen.getByRole<HTMLInputElement>('textbox', { name: 'Search plugins' })
+ fireEvent.pointerDown(sash, { button: 0, clientY: 600 })
+ fireEvent.pointerMove(window, { clientY: 400 })
+ fireEvent.pointerUp(window)
- 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()
- expect(search.value).toBe('weather')
- fireEvent.click(screen.getAllByRole('button', { name: 'Clear filters' })[0])
- 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()
- })
-
- it('retries a failed catalog only when asked, not on tab bounce', async () => {
- queryClient.clear()
-
- const fetchCatalog = vi
- .fn()
- .mockResolvedValueOnce({ ok: false, status: 503 })
- .mockResolvedValue({ ok: true, json: async () => [weatherEntry] })
-
- vi.stubGlobal('fetch', fetchCatalog)
- const view = renderPlugins({ profile: null })
-
- expect(await screen.findByText('Catalog HTTP 503')).toBeTruthy()
- expect(fetchCatalog).toHaveBeenCalledTimes(1)
- view.unmount()
- await act(async () => {
- renderPlugins({ profile: null })
- })
- expect(fetchCatalog).toHaveBeenCalledTimes(1)
- expect(screen.getByText('Catalog HTTP 503')).toBeTruthy()
- fireEvent.click(screen.getByRole('button', { name: 'Try again' }))
+ // 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', () => {
@@ -765,7 +545,7 @@ describe('PluginsTab catalog UX', () => {
}
])
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
expect(screen.getByRole('button', { name: `Update to ${'b'.repeat(8)}` })).toBeTruthy()
})
@@ -788,7 +568,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()
@@ -811,17 +591,14 @@ describe('PluginsTab catalog UX', () => {
version: '1.0.0'
}
])
- requestGateway.mockImplementation(async (_method, params) =>
- params?.action === 'remove' ? { ok: true, name: 'demo-weather' } : { plugins: $agentPlugins.get() }
- )
+ requestGateway.mockResolvedValue({ ok: true, name: 'demo-weather', plugins: [] } as never)
- renderPlugins({ profile: 'workbot' })
+ render(<PluginsTab profile="workbot" />)
screen.getByRole('button', { name: 'Uninstall: demo-weather' }).click()
// The click only asks; nothing is deleted until the destructive confirm is answered.
await waitFor(() => expect($confirmRequest.get()?.title).toContain('demo-weather'))
- expect(screen.getByRole('row', { name: /^demo-weather/ })).toBeTruthy()
expect(requestGateway).not.toHaveBeenCalledWith('plugins.manage', expect.objectContaining({ action: 'remove' }))
settleConfirm(true)
@@ -841,7 +618,7 @@ describe('PluginsTab catalog UX', () => {
})
uninstallDiskPlugin.mockClear()
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
screen.getByRole('button', { name: 'Uninstall: Clock' }).click()
@@ -861,11 +638,10 @@ describe('PluginsTab catalog UX', () => {
media: { id: 'media', name: 'Media Studio', kind: 'disk', status: 'loaded', packageName: 'hermes-media-studio' }
})
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
- fireEvent.click(screen.getByRole('button', { name: /^Bot Mode/ }))
- expect(screen.queryByRole('button', { name: /^Uninstall:/ })).toBeNull()
- fireEvent.click(screen.getByRole('button', { name: /^Media Studio/ }))
+ expect(screen.getByText('Bot Mode')).toBeTruthy()
+ expect(screen.getByText('Media Studio')).toBeTruthy()
expect(screen.queryByRole('button', { name: /^Uninstall:/ })).toBeNull()
})
@@ -874,14 +650,13 @@ describe('PluginsTab catalog UX', () => {
{ description: '', key: 'demo-tool', name: 'demo-tool', source: 'entrypoint', status: 'enabled', version: '' }
])
- renderPlugins({ profile: null })
+ render(<PluginsTab profile={null} />)
- expect(screen.getByRole('row', { name: /^demo-tool/ })).toBeTruthy()
+ expect(screen.getByText('demo-tool')).toBeTruthy()
expect(screen.queryByRole('button', { name: 'Uninstall: demo-tool' })).toBeNull()
})
- it('toggles an installed catalog card on and off in place instead of reinstalling or uninstalling it', async () => {
- $catalogCardView.set(true)
+ it('refuses a catalog pick that is already installed and current', async () => {
$agentPlugins.set([
{
catalog_name: 'demo-weather',
@@ -891,35 +666,57 @@ describe('PluginsTab catalog UX', () => {
name: 'demo-weather',
source: 'git',
status: 'enabled',
+ update_available: false,
version: '1.0.0'
}
])
- requestGateway.mockImplementation(async (_method, params) =>
- params?.action === 'toggle'
- ? { ok: true, plugin: { key: 'demo-weather', name: 'demo-weather', status: 'disabled' } }
- : { plugins: $agentPlugins.get() }
+
+ 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'
+ })
)
- seedCatalog([{ ...weatherEntry, name: 'demo-weather' }])
- await act(async () => {
- renderPlugins({ profile: 'workbot' })
- })
- const card = screen
- .getAllByRole('article')
- .find(article => within(article).queryByRole('button', { name: 'demo-weather' }))!
+ // The modal must NOT open — the pick is refused with a toast.
+ await new Promise(resolve => setTimeout(resolve, 20))
+ expect($pluginInstallRequest.get()).toBeNull()
+ })
+
+ it('still opens the modal for an installed pick when an update is available', async () => {
+ $agentPlugins.set([
+ {
+ catalog_name: 'demo-weather',
+ description: '',
+ installed_sha: 'a'.repeat(40),
+ key: 'demo-weather',
+ name: 'demo-weather',
+ source: 'git',
+ status: 'enabled',
+ update_available: true,
+ version: '1.0.0'
+ }
+ ])
- const toggle = within(card).getByRole('switch', { name: 'demo-weather' })
- expect(toggle.getAttribute('aria-checked')).toBe('true')
- fireEvent.click(toggle)
+ render(<PluginsTab profile={null} />)
- await waitFor(() =>
- expect(requestGateway).toHaveBeenCalledWith(
- 'plugins.manage',
- expect.objectContaining({ action: 'toggle', key: 'demo-weather', enable: false, profile: 'workbot' })
- )
+ 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'
+ })
)
- expect($confirmRequest.get()).toBeNull()
- expect($pluginInstallRequest.get()).toBeNull()
- expect(requestGateway).not.toHaveBeenCalledWith('plugins.manage', expect.objectContaining({ action: 'remove' }))
+
+ await waitFor(() => expect($pluginInstallRequest.get()).not.toBeNull())
})
})
diff --git a/apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx b/apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx
index 6a3ea5ebd06..03ff2ab519c 100644
--- a/apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx
+++ b/apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx
@@ -1,5 +1,13 @@
import { useStore } from '@nanostores/react'
-import { memo, type ReactNode, useCallback, useEffect, useMemo, useState } from 'react'
+import {
+ memo,
+ type ReactNode,
+ type PointerEvent as ReactPointerEvent,
+ useEffect,
+ useMemo,
+ useRef,
+ useState
+} from 'react'
import { setEnvVar } from '@/api/config'
import { getToolsets, setToolsetEnabled } from '@/api/toolsets'
@@ -15,6 +23,7 @@ import { useI18n } from '@/i18n'
import { DESKTOP_PLUGIN_TOOLSETS } from '@/lib/desktop-toolsets'
import { triggerHaptic } from '@/lib/haptics'
import { FolderOpen, Loader2, Monitor, Package, RefreshCw, Trash2 } from '@/lib/icons'
+import { CATALOG_ORIGIN, CATALOG_PICKER_URL } from '@/lib/plugin-catalog'
import { queryClient } from '@/lib/query-client'
import { cn } from '@/lib/utils'
import {
@@ -35,20 +44,49 @@ import {
} from '@/store/agent-plugins'
import { confirm } from '@/store/confirm'
import { notify, notifyError } from '@/store/notifications'
+import { $paneHeightOverride, setPaneHeightOverride } from '@/store/panes'
import { openCatalogPluginInstall } from '@/store/plugin-catalog-install'
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 { CatalogAlert } from '../catalog/catalog-alert'
-import { CatalogBrowser } from '../catalog/catalog-browser'
-import { type CatalogEntry, parseCatalog } from '../catalog/catalog-data'
import { TOOLSETS_QUERY_KEY } from '../toolsets/toolsets-data'
import { mergePluginPackages, type PackageKind, type PluginPackage } from './plugin-packages'
import { PluginSettingsForm } from './plugin-settings-form'
+// 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. URLs live in `@/lib/plugin-catalog` so the
+// `hermes://plugin/install?catalog=` deep link resolves against the same feed.
+
+// 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 (`/capabilities?tab=plugins&plugin=<key>`).
* Accepts the agent key, the agent name, or the desktop record id. */
export const pluginElementId = (target: string) => `plugin-${target}`
@@ -178,11 +216,15 @@ function ProvenancePill({ pkg }: { pkg: PluginPackage }) {
return null
}
-/** Controls for one installed plugin half in the detail pane. */
-function HalfCell({ label, labelContent, children }: { label: string; labelContent?: ReactNode; children: ReactNode }) {
+/** 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)">{labelContent ?? label}</span>
+ <div aria-label={label} className={HALF_COL} role="cell">
{children}
</div>
)
@@ -201,7 +243,6 @@ function PackageRow({
scope,
profile,
scopeLabel,
- scopeSelector,
busy,
request,
onAgentToggle,
@@ -213,7 +254,6 @@ function PackageRow({
scope: null | string
profile: ProfileScope
scopeLabel: string
- scopeSelector?: ReactNode
busy: boolean
request: GatewayRequest
onAgentToggle: (row: AgentPluginRow, enable: boolean) => void
@@ -299,12 +339,15 @@ function PackageRow({
return (
<>
<div
- className="flex flex-col gap-5"
+ className={cn(
+ 'flex items-center gap-3 border-b border-(--ui-stroke-tertiary) px-3 py-2.5',
+ !settingsOpen && '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>
@@ -428,7 +471,7 @@ function PackageRow({
)}
</HalfCell>
- <HalfCell label={p.halfAgentIn(scopeLabel)} labelContent={scopeSelector}>
+ <HalfCell label={p.halfAgentIn(scopeLabel)}>
{agent ? (
<>
{agent.update_available && (
@@ -478,7 +521,7 @@ function PackageRow({
</HalfCell>
</div>
{hasSettings && settingsOpen && agent?.key && (
- <div className="mt-5">
+ <div className="border-b border-(--ui-stroke-tertiary) bg-(--ui-bg-secondary,transparent) px-3 py-3 last:border-b-0">
<PluginSettingsForm
disabled={busy}
fields={settingsFields}
@@ -506,58 +549,25 @@ 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 onClick={() => openPluginInstallRequest({ profile: scope, repo: '' })} size="xs" variant="textStrong">
- {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={() => {
- triggerHaptic('selection')
- void rescanAll(requestGateway, scope)
- }}
- size="icon-xs"
- variant="ghost"
- >
- <RefreshCw />
- </Button>
- </Tip>
- </>
- )
-}
-
-/** Installed packages retain both halves' controls in the native detail pane.
- * Browse shares the Skills catalog; navigation and search belong to the shell. */
+/** 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). Discovery sits underneath: the live
+ * catalog picker plus Install from Git for anything not in the catalog. */
export const PluginsTab = memo(function PluginsTab({
profile,
scopeSelector,
- scopeLabel,
- query,
- onQueryChange
+ scopeLabel
}: {
profile: ProfileScope
- query?: string
- onQueryChange?: (value: string) => void
- /** The profile selector governs only the Agent half, not the app-level Desktop half. */
+ /** 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 half label. */
+ /** 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)
@@ -578,237 +588,316 @@ export const PluginsTab = memo(function PluginsTab({
[agentRows, desktopRecords]
)
- const [selectedEntryId, setSelectedEntryId] = useState<string | null>(null)
-
- const packageForTarget = useCallback(
- (target: string) =>
- packages.find(pkg => [pkg.key, pkg.agent?.key, pkg.agent?.name, pkg.desktop?.id].includes(target)),
- [packages]
- )
-
- useDeepLinkHighlight({
- param: 'plugin',
- ready: target => Boolean(packageForTarget(target)),
- elementId: target => {
- const pkg = packageForTarget(target)
-
- return pluginElementId(pkg?.agent?.key ?? pkg?.agent?.name ?? pkg?.desktop?.id ?? target)
- },
- onResolve: useCallback(
- (target: string) => {
- const pkg = packageForTarget(target)
-
- if (pkg) {
- onQueryChange?.('')
- setSelectedEntryId(`installed:${pkg.key}`)
- }
- },
- [onQueryChange, packageForTarget]
- )
- })
-
- 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.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 => ({ ...entry, id: `installed:${entry.identifier}` })),
- [packages]
- )
-
- const packageById = useMemo(() => new Map(packages.map(pkg => [`installed:${pkg.key}`, pkg])), [packages])
+ useDeepLinkHighlight({ param: 'plugin', ready: () => true, elementId: pluginElementId })
- const installedByCatalogName = useMemo(() => {
- const byName = new Map<string, CatalogEntry>()
+ // 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)
- for (const entry of installedEntries) {
- const pkg = packageById.get(entry.id)
- const name = pkg?.agent?.catalog_name ?? pkg?.desktop?.packageOrigin?.catalogName
+ if (open && !pickerMounted) {
+ setPickerMounted(true)
+ }
- if (name) {
- byName.set(name, entry)
- }
+ const startDrag = (event: ReactPointerEvent<HTMLDivElement>) => {
+ if (event.button !== 0) {
+ return
}
- return byName
- }, [installedEntries, packageById])
-
- const matchInstalled = useCallback(
- (entry: CatalogEntry) => installedByCatalogName.get(entry.name),
- [installedByCatalogName]
- )
-
- const isInstalled = (entry: CatalogEntry) => packageById.has(entry.id)
-
- const handleAgentRemove = useCallback(
- (row: AgentPluginRow) => {
- void confirm({
- confirmLabel: p.uninstall,
- description: p.uninstallConfirmBody(row.name, label),
- destructive: true,
- title: p.uninstallConfirmTitle(row.name)
- }).then(async ok => {
- if (!ok) {
- 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))))
+ )
+ }
- if (await removeAgentPlugin(requestGateway, row.name, p.uninstallFailed(row.name), scope)) {
- notify({ kind: 'success', message: p.uninstalled(row.name) })
- // Prunes the app-level desktop half whose source package just went away.
- void rescanAll(requestGateway, scope)
- }
- })
- },
- [label, p, requestGateway, scope]
- )
+ const onUp = () => {
+ window.removeEventListener('pointermove', onMove)
+ setDragging(false)
+ }
- const handleDesktopRemove = useCallback(
- (record: PluginRecord) => {
- void confirm({
- confirmLabel: p.uninstall,
- description: p.uninstallDesktopConfirmBody(record.name),
- destructive: true,
- title: p.uninstallConfirmTitle(record.name)
- }).then(async ok => {
- if (!ok) {
- return
- }
+ window.addEventListener('pointermove', onMove)
+ window.addEventListener('pointerup', onUp, { once: true })
+ }
- const result = await uninstallDiskPlugin(record.id)
+ useEffect(() => {
+ if (!open) {
+ return undefined
+ }
- if (result.ok) {
- notify({ kind: 'success', message: p.uninstalledDesktop(record.name) })
- } else {
- notifyError(result.error, p.uninstallFailed(record.name))
- }
- })
- },
- [p]
- )
+ const onMessage = (event: MessageEvent) => {
+ if (event.origin !== CATALOG_ORIGIN) {
+ return
+ }
- // The card switch turns the whole package on or off, like a skill's; per-half
- // switches and uninstall (trash + confirm) live in the detail's PackageRow.
- const packageSwitch = (pkg: PluginPackage) => {
- const { agent, desktop } = pkg
+ const data = event.data as null | PluginPickMessage
- const setEnabled = (enable: boolean) => {
- if (agent?.key) {
- void toggleAgentPlugin(requestGateway, agent.key, enable, p.toggleFailed(agent.name), scope)
+ if (!data || data.type !== 'hermes-plugin-pick' || !data.name || !data.repo) {
+ return
}
- if (desktop) {
- void setPluginEnabled(desktop.id, enable)
- }
+ // Already-installed short-circuit + the dialog itself live in the shared
+ // helper so a catalog deep link behaves identically to this pick.
+ openCatalogPluginInstall(
+ {
+ name: String(data.name),
+ repo: String(data.repo),
+ sha: data.sha ? String(data.sha) : undefined,
+ subdir: data.subdir ? String(data.subdir) : undefined
+ },
+ scope
+ )
}
- return (
- <Switch
- aria-label={pkg.name}
- checked={agent ? agent.status === 'enabled' : desktop?.status !== 'disabled'}
- disabled={agent ? !agent.key || agentBusy(agent) : false}
- onCheckedChange={setEnabled}
- size="xs"
- />
- )
- }
+ window.addEventListener('message', onMessage)
- const notice =
- status === 'error' ? (
- <CatalogAlert
- onRetry={() => void loadAgentPlugins(requestGateway, scope)}
- retryLabel={t.skills.refresh}
- title={p.loadFailed}
- >
- {error}
- </CatalogAlert>
- ) : null
+ return () => window.removeEventListener('message', onMessage)
+ }, [open, p, scope])
- return (
- <CatalogBrowser
- headerActions={<PluginActions profile={profile} />}
- installedEntries={installedEntries}
- installedPending={status !== 'ready'}
- isInstalled={isInstalled}
- kind="plugins"
- matchInstalled={matchInstalled}
- notice={notice}
- onInstall={entry => openCatalogPluginInstall(entry, scope)}
- onQueryChange={onQueryChange}
- query={query}
- renderInstalledAction={entry => {
- const pkg = packageById.get(entry.id)
-
- return pkg ? packageSwitch(pkg) : null
- }}
- renderInstalledDetail={entry => {
- const pkg = packageById.get(entry.id)
-
- if (!pkg) {
- return null
- }
-
- return (
- <PackageRow
- busy={pkg.agent ? agentBusy(pkg.agent) : false}
- key={pkg.key}
- onAgentRemove={handleAgentRemove}
- onAgentToggle={(row, enable) => {
- if (!row.key) {
- return
- }
+ const agentBusy = (row: AgentPluginRow) => busyKey === (row.key ?? row.name) || busyKey === row.name
- void toggleAgentPlugin(requestGateway, row.key, enable, p.toggleFailed(row.name), scope)
- }}
- onAgentUpdate={row => {
- const finish = (outcome: AgentPluginUpdateOutcome) => {
- if (outcome.kind === 'applied') {
- notify({ kind: 'success', message: p.updated(row.name) })
+ return (
+ <div className="flex h-full min-h-0 flex-col">
+ <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)
- }
- }
-
- void updateAgentPlugin(requestGateway, row.name, p.updateFailed(row.name), scope).then(async outcome => {
- if (outcome.kind !== 'consent') {
- finish(outcome)
-
- return
- }
+ }}
+ size="icon"
+ type="button"
+ variant="ghost"
+ >
+ <RefreshCw className="size-3.5" />
+ </Button>
+ </Tip>
+ </div>
+ </div>
- // The new pin widens the plugin (tools, hooks, deps, capabilities, a Desktop
- // half); the backend changed nothing until the user confirms the delta.
- const ok = await confirm({
- confirmLabel: p.updateConsentConfirm,
- description: [p.updateConsentBody(row.name, outcome.sha), ...outcome.deltaLines].join('\n'),
- title: p.updateConsentTitle(row.name)
- })
+ {status === 'error' ? (
+ <PanelEmpty
+ action={
+ <Button onClick={() => void loadAgentPlugins(requestGateway, scope)} size="sm">
+ {t.skills.refresh}
+ </Button>
+ }
+ description={error ?? undefined}
+ icon="error"
+ title={p.loadFailed}
+ />
+ ) : 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}
+ onAgentRemove={row => {
+ void confirm({
+ confirmLabel: p.uninstall,
+ description: p.uninstallConfirmBody(row.name, label),
+ destructive: true,
+ title: p.uninstallConfirmTitle(row.name)
+ }).then(async ok => {
+ if (!ok) {
+ return
+ }
+
+ if (await removeAgentPlugin(requestGateway, row.name, p.uninstallFailed(row.name), scope)) {
+ notify({ kind: 'success', message: p.uninstalled(row.name) })
+ // Prunes the app-level desktop half whose source package just went away.
+ void rescanAll(requestGateway, scope)
+ }
+ })
+ }}
+ onAgentToggle={(row, enable) => {
+ if (!row.key) {
+ return
+ }
+
+ void toggleAgentPlugin(requestGateway, row.key, enable, p.toggleFailed(row.name), scope)
+ }}
+ onAgentUpdate={row => {
+ const finish = (outcome: AgentPluginUpdateOutcome) => {
+ if (outcome.kind === 'applied') {
+ notify({ kind: 'success', message: p.updated(row.name) })
+ void rescanAll(requestGateway, scope)
+ }
+ }
+
+ void updateAgentPlugin(requestGateway, row.name, p.updateFailed(row.name), scope).then(
+ async outcome => {
+ if (outcome.kind !== 'consent') {
+ finish(outcome)
+
+ return
+ }
+
+ // The new pin widens the plugin (tools, hooks, deps, capabilities, a Desktop
+ // half); the backend changed nothing until the user confirms the delta.
+ const ok = await confirm({
+ confirmLabel: p.updateConsentConfirm,
+ description: [p.updateConsentBody(row.name, outcome.sha), ...outcome.deltaLines].join('\n'),
+ title: p.updateConsentTitle(row.name)
+ })
+
+ if (ok) {
+ finish(await updateAgentPlugin(requestGateway, row.name, p.updateFailed(row.name), scope, true))
+ }
+ }
+ )
+ }}
+ onDesktopRemove={record => {
+ void confirm({
+ confirmLabel: p.uninstall,
+ description: p.uninstallDesktopConfirmBody(record.name),
+ destructive: true,
+ title: p.uninstallConfirmTitle(record.name)
+ }).then(async ok => {
+ if (!ok) {
+ return
+ }
+
+ const result = await uninstallDiskPlugin(record.id)
+
+ if (result.ok) {
+ notify({ kind: 'success', message: p.uninstalledDesktop(record.name) })
+ } else {
+ notifyError(result.error, p.uninstallFailed(record.name))
+ }
+ })
+ }}
+ pkg={pkg}
+ profile={profile}
+ request={requestGateway}
+ scope={scope}
+ scopeLabel={label}
+ />
+ ))}
+ </div>
+ )}
+ </div>
- if (ok) {
- finish(await updateAgentPlugin(requestGateway, row.name, p.updateFailed(row.name), scope, true))
- }
- })
- }}
- onDesktopRemove={handleDesktopRemove}
- pkg={pkg}
- profile={profile}
- request={requestGateway}
- scope={scope}
- scopeLabel={label}
- scopeSelector={scopeSelector}
+ <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)'
+ )}
/>
- )
- }}
- selectedEntryId={selectedEntryId}
- />
+ </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/capabilities/skills/embedded-hub-picker.tsx b/apps/desktop/src/app/capabilities/skills/embedded-hub-picker.tsx
new file mode 100644
index 00000000000..7d9fdbe5351
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/skills/embedded-hub-picker.tsx
@@ -0,0 +1,255 @@
+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/capabilities/skills/skill-detail.tsx b/apps/desktop/src/app/capabilities/skills/skill-detail.tsx
index 260b4c02c91..58d4ab06a50 100644
--- a/apps/desktop/src/app/capabilities/skills/skill-detail.tsx
+++ b/apps/desktop/src/app/capabilities/skills/skill-detail.tsx
@@ -1,14 +1,19 @@
import { useQuery } from '@tanstack/react-query'
import { useMemo } from 'react'
-import { PageLoader } from '@/components/page-loader'
import { Button } from '@/components/ui/button'
+import { CountSkeleton } from '@/components/ui/skeleton'
import { getSkillContent, type ProfileScope, profileScopeKey } from '@/hermes'
import { useI18n } from '@/i18n'
import type { SkillInfo } from '@/types/hermes'
+import { PanelPill } from '../../overlays/panel'
+import { asText, prettyName } from '../../settings/helpers'
+import { DetailHeader } from '../primitives'
+
import { parseFrontmatter } from './frontmatter'
import { isEditableProvenance } from './skill-provenance'
+import { categoryFor } from './skills-data'
export function SkillDetail({
onArchive,
@@ -42,6 +47,20 @@ export function SkillDetail({
return (
<>
+ <DetailHeader
+ description={asText(skill.description) || t.skills.noDescription}
+ pills={
+ <>
+ <PanelPill>{prettyName(categoryFor(skill))}</PanelPill>
+ {(skill.provenance === 'agent' || skill.provenance === 'hub') && (
+ <PanelPill tone={skill.provenance === 'agent' ? 'good' : 'muted'}>
+ {t.skills.provenance[skill.provenance]}
+ </PanelPill>
+ )}
+ </>
+ }
+ title={skill.name}
+ />
{editable && (
<div className="flex items-center gap-2">
<Button onClick={onEdit} size="xs" variant="text">
@@ -52,11 +71,21 @@ export function SkillDetail({
</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>
+ )}
{contentQuery.isLoading ? (
- <PageLoader className="h-40" label={t.skills.loading} />
+ <CountSkeleton />
) : parsed ? (
<pre
- className="overflow-auto whitespace-pre-wrap wrap-break-word font-mono text-[0.68rem] leading-relaxed text-(--ui-text-secondary)"
+ 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}
diff --git a/apps/desktop/src/app/capabilities/skills/skills-tab.tsx b/apps/desktop/src/app/capabilities/skills/skills-tab.tsx
index f83d567f904..f13b23956cf 100644
--- a/apps/desktop/src/app/capabilities/skills/skills-tab.tsx
+++ b/apps/desktop/src/app/capabilities/skills/skills-tab.tsx
@@ -1,358 +1,387 @@
-import { useCallback, useEffect, useRef, useState } from 'react'
+import { compactNumber } from '@hermes/shared'
+import { useStore } from '@nanostores/react'
+import { useQuery } from '@tanstack/react-query'
+import { type ReactNode, useCallback, useMemo, useState } from 'react'
import { ArchiveSkillConfirmDialog } from '@/app/learning/archive-skill-confirm-dialog'
import { CodeEditor } from '@/components/chat/code-editor'
+import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
-import { Loader } from '@/components/ui/loader'
-import { Switch } from '@/components/ui/switch'
-import { editLearningNode, getLearningNode, type ProfileScope, profileScopeKey, setSkillEnabled } from '@/hermes'
+import {
+ editLearningNode,
+ getLearningNode,
+ getOfficialSkills,
+ type ProfileScope,
+ profileScopeKey,
+ setSkillEnabled
+} from '@/hermes'
import { useI18n } from '@/i18n'
+import { Loader2 } from '@/lib/icons'
+import { Codecs, persistentAtom } from '@/lib/persisted'
import { queryClient } from '@/lib/query-client'
import { invalidateSlashCompletions } from '@/lib/slash-completion-cache'
+import { useStoreSelector } from '@/lib/use-session-slice'
+import { $hubActions, installHubSkill, notifyHubActionFailed, OFFICIAL_SKILLS_KEY } from '@/store/hub-actions'
import { notify, notifyError } from '@/store/notifications'
-import type { SkillInfo } from '@/types/hermes'
+import type { OfficialSkillInfo, SkillInfo } from '@/types/hermes'
+
+import {
+ CapRow,
+ DetailColumn,
+ DetailPane,
+ ListColumn,
+ ListStrip,
+ ListStripMenu,
+ type ListStripMenuToggle,
+ MasterDetail
+} from '../../master-detail'
+import { prettyName } from '../../settings/helpers'
+import { CapabilityEmpty, SortButton } from '../primitives'
+
+import { OfficialSkillDetail } from './official-skill-detail'
+import { SkillDetail } from './skill-detail'
+import { categoryFor, filteredOfficial, filteredSkills, skillsQueryKey, usageOf } from './skills-data'
-import { DetailPane, ListStripMenu, type ListStripMenuToggle } from '../../master-detail'
-import { CatalogAlert } from '../catalog/catalog-alert'
-import { SkillCatalog } from '../catalog/skill-catalog'
-import { UpdateSkillsButton } from '../catalog/update-skills-button'
+// Sort direction for the Skills list — persisted so the tab remembers
+// most/least-used across navigations and restarts.
+const $skillsSortDesc = persistentAtom('hermes.desktop.capabilities.skillsSortDesc', true, Codecs.bool)
-import { SkillDetail } from './skill-detail'
-import { skillsQueryKey, usageOf } from './skills-data'
+// Row subtitle: category, with non-default origins badged.
+function skillSubtitle(skill: SkillInfo): ReactNode {
+ const category = prettyName(categoryFor(skill))
+ const provenance = skill.provenance
+
+ return (
+ <>
+ <span className="truncate">{category}</span>
+ {provenance === 'agent' && (
+ <Badge className="shrink-0 normal-case" variant="default">
+ learned
+ </Badge>
+ )}
+ {provenance === 'hub' && (
+ <Badge className="shrink-0 normal-case" variant="muted">
+ hub
+ </Badge>
+ )}
+ </>
+ )
+}
interface SkillsTabProps {
/** The scope's skill list, straight from the shell's query. */
skills: SkillInfo[]
- /** Every read and write targets this connection/profile pair. */
+ /** The (connection, profile) scope every read and write routes to. */
profile: ProfileScope
query: string
- onQueryChange?: (value: string) => void
- installedPending?: boolean
- installedError?: unknown
+ /** Page-level refresh: a saved skill edit reloads the same way the refresh
+ * hotkey does, counts and slash completions included. */
onRefresh: () => void
}
-/** One management controller for the unified catalog, remounted on scope changes
- * so an old profile's editor, confirmation or pending write cannot enter another. */
-export function SkillsTab(props: SkillsTabProps) {
- return <ScopedSkillsTab key={profileScopeKey(props.profile)} {...props} />
-}
-
-function ScopedSkillsTab({
- onRefresh,
- profile,
- query,
- onQueryChange,
- skills,
- installedPending = false,
- installedError
-}: SkillsTabProps) {
+/** The Skills tab: installed skills, official optional skills, and learned-skill editing. */
+export function SkillsTab({ onRefresh, profile, query, skills }: SkillsTabProps) {
const { t } = useI18n()
- const mounted = useRef(true)
- const mutationBusy = useRef(false)
- const editorRequest = useRef(0)
- const saving = useRef(false)
- const [busy, setBusy] = useState(false)
- const [skillEditor, setSkillEditor] = useState<null | { name: string }>(null)
+ const skillsSortDesc = useStore($skillsSortDesc)
+ const [bulkBusy, setBulkBusy] = useState(false)
+ const [selectedSkill, setSelectedSkill] = useState<string | null>(null)
+ const [selectedOfficial, setSelectedOfficial] = useState<string | null>(null)
+
+ const { data: officialData } = useQuery({
+ queryKey: [...OFFICIAL_SKILLS_KEY, profileScopeKey(profile)],
+ queryFn: () => getOfficialSkills(profile),
+ staleTime: 60_000,
+ retry: false
+ })
+
+ // Learned/local skills are editable + archivable, mirroring the memory
+ // graph (same /api/learning/node endpoints — delete archives, restorable
+ // via `hermes curator restore`).
+ const [skillEditor, setSkillEditor] = useState<null | { content: string; name: string }>(null)
const [skillDraft, setSkillDraft] = useState('')
const [skillSaving, setSkillSaving] = useState(false)
const [archiveTarget, setArchiveTarget] = useState<null | string>(null)
- // eslint-disable-next-line no-restricted-syntax -- lifecycle guard drops stale async completions; it does not mirror an atom
- useEffect(() => {
- mounted.current = true
-
- return () => {
- mounted.current = false
- editorRequest.current += 1
- }
- }, [])
-
+ // Optimistic write-through against the scoped Skills key: toggles/bulk/
+ // archive repaint instantly; the next background refetch reconciles.
const setSkills = useCallback(
(fn: (cur: SkillInfo[] | undefined) => SkillInfo[] | undefined) =>
queryClient.setQueryData<SkillInfo[]>(skillsQueryKey(profile), prev => fn(prev) ?? prev),
[profile]
)
- // The backend saves one disabled-list config value: serialize individual and
- // bulk changes together, not merely the members of a bulk action.
- async function applyEnabled(targets: SkillInfo[], enabled: boolean, bulk = false) {
- if (mutationBusy.current || installedPending || installedError || targets.length === 0) {
+ const visibleSkills = useMemo(() => filteredSkills(skills, query, skillsSortDesc), [query, skills, skillsSortDesc])
+
+ // Installed-name set stays unfiltered so search cannot make a skill look absent.
+ const installedSkillNames = useMemo(() => new Set(skills.map(s => s.name)), [skills])
+
+ const visibleOfficial = useMemo(() => {
+ const catalog = (officialData?.skills ?? []).filter(
+ skill => !skill.installed && !installedSkillNames.has(skill.name)
+ )
+
+ return filteredOfficial(catalog, query)
+ }, [installedSkillNames, officialData, query])
+
+ 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])
+
+ // Keep a valid selection: fall back to the first visible row when the
+ // current selection is filtered out (or nothing is selected yet).
+ const activeSkill = useMemo(
+ () => visibleSkills.find(s => s.name === selectedSkill) ?? visibleSkills[0] ?? null,
+ [selectedSkill, visibleSkills]
+ )
+
+ const activeOfficial = useMemo(
+ () => visibleOfficial.find(skill => skill.identifier === selectedOfficial) ?? null,
+ [selectedOfficial, visibleOfficial]
+ )
+
+ function handleInstallOfficial(skill: OfficialSkillInfo) {
+ notify({ kind: 'success', title: t.skills.hub.installStarted(skill.name), message: t.skills.hub.actionLog })
+ void installHubSkill(skill.identifier, profile).catch(err =>
+ notifyHubActionFailed(err, t.skills.hub.actionFailed, skill.name, profile)
+ )
+ }
+
+ async function handleToggleSkill(skill: SkillInfo, enabled: boolean) {
+ setSkills(current => current?.map(row => (row.name === skill.name ? { ...row, enabled } : row)) ?? current)
+
+ try {
+ await setSkillEnabled(skill.name, enabled, profile)
+ // A disabled skill loses its `/name` command, so the composer's cached
+ // `/` list has to be dropped along with the row repaint.
+ invalidateSlashCompletions()
+ } catch (err) {
+ setSkills(
+ current => current?.map(row => (row.name === skill.name ? { ...row, enabled: !enabled } : row)) ?? current
+ )
+ notifyError(err, t.skills.failedToUpdate(skill.name))
+ }
+ }
+
+ // Sequential on purpose: each toggle is a config read-modify-write on the
+ // backend; parallel calls would race the disabled-list save.
+ async function bulkApply(targets: SkillInfo[], enabled: boolean) {
+ if (bulkBusy || targets.length === 0) {
return
}
- mutationBusy.current = true
- setBusy(true)
+ setBulkBusy(true)
+
let done = 0
try {
- await queryClient.cancelQueries({ queryKey: skillsQueryKey(profile), exact: true })
-
for (const row of targets) {
- if (!mounted.current) {
- break
- }
-
- const previous =
- queryClient.getQueryData<SkillInfo[]>(skillsQueryKey(profile))?.find(skill => skill.name === row.name) ?? row
-
- setSkills(current => current?.map(skill => (skill.name === row.name ? { ...skill, enabled } : skill)))
-
- try {
- await setSkillEnabled(row.name, enabled, profile)
- done += 1
- } catch (err) {
- if (mounted.current) {
- setSkills(current =>
- current?.map(skill =>
- skill.name === row.name && skill.enabled === enabled ? { ...skill, enabled: previous.enabled } : skill
- )
- )
- }
-
- throw err
- }
+ await setSkillEnabled(row.name, enabled, profile)
+ setSkills(cur => cur?.map(r => (r.name === row.name ? { ...r, enabled } : r)) ?? cur)
+ done += 1
}
- if (bulk && mounted.current) {
- notify({ kind: 'success', title: t.skills.bulkUpdated(done), message: '' })
- }
+ notify({ kind: 'success', title: t.skills.bulkUpdated(done), message: '' })
} catch (err) {
- if (mounted.current) {
- notifyError(err, t.skills.failedToUpdate(bulk ? t.skills.tabSkills : targets[0].name))
- }
+ notifyError(err, t.skills.failedToUpdate(t.skills.tabSkills))
} finally {
invalidateSlashCompletions()
- void queryClient.invalidateQueries({ queryKey: skillsQueryKey(profile), exact: true })
- mutationBusy.current = false
-
- if (mounted.current) {
- setBusy(false)
- }
+ setBulkBusy(false)
}
}
- const controlsDisabled = busy || installedPending || Boolean(installedError)
+ // Bulk actions ("All" master switch, "Disable unused") and the master-switch
+ // state target the WHOLE tab, never the search-filtered view — a tab-wide
+ // control that silently scoped to the current query would be a lie.
+ const allEnabled = skills.length > 0 && skills.every(s => s.enabled)
- // Bulk always means the whole profile, never just a search/filter result.
+ // One switch line covering enable-all/disable-all.
const bulkSwitch: ListStripMenuToggle = {
- checked: skills.length > 0 && skills.every(skill => skill.enabled),
- disabled: controlsDisabled || skills.length === 0,
+ checked: allEnabled,
+ disabled: bulkBusy,
label: t.skills.all,
onToggle: checked =>
- void applyEnabled(
- skills.filter(skill => skill.enabled !== checked),
- checked,
- true
+ void bulkApply(
+ skills.filter(row => row.enabled !== checked),
+ checked
)
}
- const openSkillEditor = async (name: string) => {
- if (saving.current || skillEditor?.name === name) {
- return
- }
-
- const request = ++editorRequest.current
+ // "Never used" = zero recorded activity. The pruning move for a 100+ skill
+ // install: keep the workhorses, shed the noise.
+ const disableUnused = () =>
+ bulkApply(
+ skills.filter(skill => skill.enabled && usageOf(skill) === 0),
+ false
+ )
+ const openSkillEditor = async (name: string) => {
try {
const node = await getLearningNode(name, profile)
- if (!mounted.current || request !== editorRequest.current) {
- return
- }
-
- setSkillEditor({ name })
+ setSkillEditor({ content: node.content, name })
setSkillDraft(node.content)
} catch (err) {
- if (mounted.current && request === editorRequest.current) {
- notifyError(err, name)
- }
+ notifyError(err, name)
}
}
- const closeSkillEditor = () => {
- editorRequest.current += 1
- setSkillEditor(null)
- }
-
const saveSkillEdit = async () => {
- if (!skillEditor || saving.current) {
+ if (!skillEditor) {
return
}
- const editor = skillEditor
- const request = editorRequest.current
- saving.current = true
setSkillSaving(true)
try {
- const result = await editLearningNode(editor.name, skillDraft, profile)
-
- if (!result.ok) {
- throw new Error(result.message)
- }
-
- void queryClient.invalidateQueries({ queryKey: ['skill-content', editor.name, profileScopeKey(profile)] })
- void queryClient.invalidateQueries({ queryKey: skillsQueryKey(profile), exact: true })
- invalidateSlashCompletions()
-
- if (!mounted.current) {
- return
- }
-
- notify({ kind: 'success', title: t.skills.skillUpdated, message: t.skills.appliesToNewSessions(editor.name) })
-
- if (request === editorRequest.current) {
- setSkillEditor(null)
- }
-
+ await editLearningNode(skillEditor.name, skillDraft, profile)
+ notify({
+ kind: 'success',
+ title: t.skills.skillUpdated,
+ message: t.skills.appliesToNewSessions(skillEditor.name)
+ })
+ setSkillEditor(null)
onRefresh()
} catch (err) {
- if (mounted.current) {
- notifyError(err, editor.name)
- }
+ notifyError(err, skillEditor.name)
} finally {
- saving.current = false
-
- if (mounted.current) {
- setSkillSaving(false)
- }
+ setSkillSaving(false)
}
}
- const notice = installedError ? (
- <CatalogAlert onRetry={onRefresh} retryLabel={t.skills.refresh} title={t.skills.skillsLoadFailed}>
- {installedError instanceof Error ? installedError.message : null}
- </CatalogAlert>
- ) : installedPending ? (
- <Loader className="mx-auto my-2 size-6 text-(--ui-text-tertiary)" label={t.skills.loading} type="rose-curve" />
- ) : null
+ const skillEditorPane = skillEditor && (
+ <DetailPane
+ actions={
+ <Button disabled={skillSaving} onClick={() => void saveSkillEdit()} size="xs">
+ {skillSaving ? t.common.saving : t.common.save}
+ </Button>
+ }
+ id="skill-editor"
+ onClose={() => setSkillEditor(null)}
+ title={<span className="text-[0.68rem] font-normal text-muted-foreground/60">{skillEditor.name}/SKILL.md</span>}
+ >
+ <CodeEditor
+ filePath="SKILL.md"
+ initialValue={skillEditor.content}
+ key={skillEditor.name}
+ onCancel={() => setSkillEditor(null)}
+ onChange={setSkillDraft}
+ onSave={() => void saveSkillEdit()}
+ />
+ </DetailPane>
+ )
return (
<>
- <SkillCatalog
- actions={
- <>
- <UpdateSkillsButton profile={profile} />
- <ListStripMenu
- items={[
- {
- disabled: controlsDisabled || !skills.some(skill => skill.enabled && usageOf(skill) === 0),
- label: t.skills.disableUnused,
- onSelect: () =>
- void applyEnabled(
- skills.filter(skill => skill.enabled && usageOf(skill) === 0),
- false,
- true
- )
+ {visibleSkills.length === 0 && visibleOfficial.length === 0 ? (
+ <CapabilityEmpty noun="skills" query={query} />
+ ) : (
+ <MasterDetail pane={skillEditorPane} resizeId="capabilities-split" split="wide">
+ <ListColumn
+ header={
+ <ListStrip
+ left={<SortButton desc={skillsSortDesc} onFlip={() => $skillsSortDesc.set(!$skillsSortDesc.get())} />}
+ right={
+ <ListStripMenu
+ items={[
+ {
+ disabled: bulkBusy,
+ label: t.skills.disableUnused,
+ onSelect: () => void disableUnused()
+ }
+ ]}
+ label={t.skills.tabSkills}
+ toggle={bulkSwitch}
+ />
}
- ]}
- label={t.skills.tabSkills}
- toggle={bulkSwitch}
- />
- </>
- }
- installedPending={installedPending || Boolean(installedError)}
- notice={notice}
- onQueryChange={onQueryChange}
- profile={profile}
- query={query}
- renderInstalledAction={skill => (
- <Switch
- aria-label={skill.name}
- checked={skill.enabled}
- disabled={controlsDisabled}
- onCheckedChange={enabled => void applyEnabled([skill], enabled)}
- size="xs"
- />
- )}
- renderInstalledDetail={skill => (
- <>
- {usageOf(skill) > 0 && (
- <p className="text-xs text-(--ui-text-tertiary)">{t.skills.usageCount(usageOf(skill))}</p>
+ />
+ }
+ >
+ {visibleSkills.map(skill => (
+ <CapRow
+ 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)
+ setSelectedOfficial(null)
+ }}
+ onToggle={enabled => void handleToggleSkill(skill, enabled)}
+ subtitle={skillSubtitle(skill)}
+ title={skill.name}
+ toggleLabel={skill.name}
+ />
+ ))}
+ {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>
)}
- <SkillDetail
- onArchive={() => {
- if (!saving.current) {
- setArchiveTarget(skill.name)
- }
- }}
- onEdit={() => void openSkillEditor(skill.name)}
- profile={profile}
- skill={skill}
- />
- <p className="text-xs text-(--ui-text-tertiary)">{t.skills.changesApplyNewSessions}</p>
- {skillEditor?.name === skill.name && (
- <DetailPane
- actions={
- <Button disabled={skillSaving} onClick={() => void saveSkillEdit()} size="xs">
- {skillSaving ? t.common.saving : t.common.save}
- </Button>
- }
- id="skill-editor"
- onClose={closeSkillEditor}
- title={
- <span className="text-[0.68rem] font-normal text-muted-foreground/60">
- {skillEditor.name}/SKILL.md
- </span>
- }
- >
- <CodeEditor
- disabled={skillSaving}
- filePath="SKILL.md"
- initialValue={skillDraft}
- key={skillEditor.name}
- onCancel={closeSkillEditor}
- onChange={setSkillDraft}
- onSave={() => void saveSkillEdit()}
+ {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}
/>
- </DetailPane>
+ )
+ })}
+ </ListColumn>
+ <DetailColumn footer={t.skills.changesApplyNewSessions}>
+ {activeOfficial ? (
+ <OfficialSkillDetail
+ installing={runningInstalls.has(activeOfficial.identifier)}
+ onInstall={() => handleInstallOfficial(activeOfficial)}
+ profile={profile}
+ skill={activeOfficial}
+ />
+ ) : (
+ activeSkill && (
+ <SkillDetail
+ onArchive={() => setArchiveTarget(activeSkill.name)}
+ onEdit={() => void openSkillEditor(activeSkill.name)}
+ profile={profile}
+ skill={activeSkill}
+ />
+ )
)}
- </>
- )}
- skills={skills}
- />
+ </DetailColumn>
+ </MasterDetail>
+ )}
{archiveTarget && (
<ArchiveSkillConfirmDialog
onApply={() => {
const name = archiveTarget
+ const snapshot = skills
- const snapshot =
- queryClient.getQueryData<SkillInfo[]>(skillsQueryKey(profile))?.find(skill => skill.name === name) ??
- skills.find(skill => skill.name === name)
-
- void queryClient.cancelQueries({ queryKey: skillsQueryKey(profile), exact: true })
- setSkills(current => current?.filter(skill => skill.name !== name))
+ setSkills(current => current?.filter(skill => skill.name !== name) ?? current)
invalidateSlashCompletions()
if (skillEditor?.name === name) {
- closeSkillEditor()
+ setSkillEditor(null)
}
- // Restore only this row; never clobber intervening toggles or installs.
- return () => {
- if (mounted.current) {
- setSkills(current =>
- snapshot && current && !current.some(skill => skill.name === name) ? [...current, snapshot] : current
- )
- }
-
- void queryClient.invalidateQueries({ queryKey: skillsQueryKey(profile), exact: true })
- }
+ return () => setSkills(() => snapshot)
}}
onClose={() => setArchiveTarget(null)}
- onFailure={(err, name) => {
- if (mounted.current) {
- notifyError(err, name)
- }
- }}
- onSuccess={() => {
- void queryClient.invalidateQueries({ queryKey: skillsQueryKey(profile), exact: true })
-
- if (mounted.current) {
- onRefresh()
- }
- }}
+ onFailure={(err, name) => notifyError(err, name)}
open
profile={profile}
skillId={archiveTarget}
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 b986fade191..51e32d5bede 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,12 +1,9 @@
-import { act, renderHook, waitFor } from '@testing-library/react'
+import { renderHook, waitFor } from '@testing-library/react'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { registerTerminalContextMenu } from '@/app/right-sidebar/terminal/terminal-context-menu'
-import { setApiRequestConnection, setApiRequestProfile } from '@/hermes'
import { createClientSessionState } from '@/lib/chat-runtime'
import { adoptNewSessionDraft, stashSessionDraft, takeSessionDraft } from '@/store/composer'
-import { $confirmRequest, runConfirm, settleConfirm } from '@/store/confirm'
-import { $hubInstalledOverride } from '@/store/hub-actions'
import { requestMcpInstallFromDeepLink } from '@/store/mcp-deeplink-install'
import { requestPluginCatalogInstallFromDeepLink } from '@/store/plugin-catalog-install'
import { openPluginInstallRequest } from '@/store/plugin-install-request'
@@ -73,8 +70,6 @@ describe('useDesktopIntegrations', () => {
window.localStorage.clear()
_resetLegacyDiscardForTests()
vi.mocked(requestMcpInstallFromDeepLink).mockClear()
- vi.mocked(requestPluginCatalogInstallFromDeepLink).mockClear()
- vi.mocked(openPluginInstallRequest).mockClear()
navigate = vi.fn()
// Every test starts as a main window; only the HUD describe flips this.
hudWindowMock.mockReturnValue(false)
@@ -663,7 +658,7 @@ describe('useDesktopIntegrations', () => {
render({ profileReady: true, sessions })
- // /capabilities is not a session route — no ownership validation needed.
+ // /skills is not a session route — no ownership validation needed.
expect(navigate).toHaveBeenCalledWith('/capabilities', { replace: true })
})
@@ -828,111 +823,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)
- $hubInstalledOverride.set({})
- setApiRequestConnection(null)
- setApiRequestProfile(null)
- })
-
- it('opens repository confirmation without trusting catalog metadata from the link', () => {
- const deepLink = listen()
- const params = { repo: 'owner/repo#plugin', catalog_name: 'catalog-plugin', sha: 'display-pin' }
- deepLink({ kind: 'plugin', name: 'install', params })
-
- expect(openPluginInstallRequest).toHaveBeenCalledExactlyOnceWith({
- repo: params.repo,
- enable: true,
- force: false,
- legacyHint: null
- })
- expect(requestPluginCatalogInstallFromDeepLink).not.toHaveBeenCalled()
- expect(navigate).not.toHaveBeenCalled()
- })
-
- it('requires skill confirmation, preserves the request scope, and uses the hub pipeline', async () => {
- const api = vi.fn(async (request: { path: string }) => {
- if (request.path === '/api/skills/hub/install') {
- return { name: 'skill-link-test' }
- }
-
- if (request.path.startsWith('/api/actions/skill-link-test/')) {
- return { name: 'skill-link-test', running: false, exit_code: 0, lines: ['Installed'], pid: 123 }
- }
-
- return {}
- })
-
- desktopWindow.hermesDesktop = { ...desktopWindow.hermesDesktop, api } as unknown as Window['hermesDesktop']
- const deepLink = listen()
- const installs = () => api.mock.calls.filter(([r]) => r.path === '/api/skills/hub/install')
- const identifier = 'skills-sh/owner/repo/skill'
- const payload = { kind: 'skill', name: 'install', params: { identifier } }
-
- for (const [connection, profile] of [
- ['server-a', 'research'],
- ['server-b', 'work'],
- ['server-a', 'research']
- ]) {
- setApiRequestConnection(connection)
- setApiRequestProfile(profile)
- api.mockClear()
- $hubInstalledOverride.set({})
- act(() => deepLink(payload))
- expect($confirmRequest.get()?.title).toBe('Install “skill”?')
- expect($confirmRequest.get()?.details).toEqual([
- { label: 'Source', value: identifier },
- { label: 'Install to', value: `${connection} · ${profile}` }
- ])
- expect(installs()).toHaveLength(0)
- await act(async () => settleConfirm(false))
- expect(installs()).toHaveLength(0)
-
- act(() => deepLink(payload))
- await act(async () => runConfirm($confirmRequest.get()!))
- expect($confirmRequest.get()?.phase).toBe('done')
- settleConfirm(true)
- await waitFor(() => expect($hubInstalledOverride.get()[identifier]).toBe(true))
- expect(installs()).toEqual([
- [
- {
- connectionId: connection,
- profile,
- priority: 'foreground',
- path: '/api/skills/hub/install',
- method: 'POST',
- body: { identifier }
- }
- ]
- ])
- expect(api).toHaveBeenCalledWith({
- connectionId: connection,
- profile,
- priority: 'foreground',
- path: '/api/actions/skill-link-test/status?lines=200'
- })
- }
-
- api.mockClear()
- act(() => deepLink(payload))
- setApiRequestConnection('server-b')
- setApiRequestProfile('work')
- await expect(runConfirm($confirmRequest.get()!)).rejects.toThrow('The destination changed')
- settleConfirm(false)
- expect(installs()).toHaveLength(0)
- act(() => deepLink({ kind: 'skill', name: 'install', params: {} }))
- expect($confirmRequest.get()).toBeNull()
- expect(navigate).not.toHaveBeenCalled()
- })
- })
-
describe('notification click -> focus-session id translation', () => {
function withFocusSession(): (sessionId: string) => void {
let handler: ((sessionId: string) => void) | 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 9237c642d5a..d7e208313a4 100644
--- a/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts
+++ b/apps/desktop/src/app/contrib/hooks/use-desktop-integrations.ts
@@ -37,7 +37,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, isPeerInstanceWindow, isSecondaryWindow } from '@/store/windows'
import type { SessionInfo } from '@/types/hermes'
@@ -379,7 +378,6 @@ export function useDesktopIntegrations({
// names toast an error and never fall back to a git-path install.
// - plugin/install?… (and legacy plugin-agent/plugin-desktop) → plugin install
// modal awaiting explicit confirmation. Never auto-installs.
- // - skill/install?identifier=… → confirmation, then the existing hub pipeline
// - blueprint/<name>?… → reviewable /blueprint command in the composer
// - <plugin>/<path>?… → in-app navigate (e.g. index-network/intent/1)
// - open/<path>?… → in-app navigate (generic)
@@ -448,16 +446,6 @@ export function useDesktopIntegrations({
return
}
- if (action.type === 'skill-install') {
- void requestSkillInstallFromDeepLink(action.identifier)
-
- return
- }
-
- if (payload.kind === 'skill') {
- return
- }
-
// Not a core action — treat as a plugin-scoped or open/ navigation deep
// link (hermes://index-network/intent/1, hermes://open/…). The resolver
// rejects reserved kinds and unsafe paths.
diff --git a/apps/desktop/src/app/master-detail.tsx b/apps/desktop/src/app/master-detail.tsx
index af19d16ff3f..92d22765c7b 100644
--- a/apps/desktop/src/app/master-detail.tsx
+++ b/apps/desktop/src/app/master-detail.tsx
@@ -395,16 +395,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,
@@ -419,8 +409,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/overlays/overlay-split-layout.tsx b/apps/desktop/src/app/overlays/overlay-split-layout.tsx
index 61ed18fad99..562d83dea76 100644
--- a/apps/desktop/src/app/overlays/overlay-split-layout.tsx
+++ b/apps/desktop/src/app/overlays/overlay-split-layout.tsx
@@ -34,18 +34,13 @@ interface OverlayMainProps {
interface OverlayNavItemProps {
active: boolean
current?: boolean
- /** Optional: filter/value rows (catalog facets) read as plain labels. */
- icon?: IconComponent
+ icon: IconComponent
/** Stable identity for the row, used as its `data-tour` handle. */
id?: string
label: string
// Renders as an indented child of another nav item: smaller icon and a
// lighter active state so it never competes with the boxed parent item.
nested?: boolean
- /** Presentational only (e.g. `CheckboxMark`); the row stays the one control. */
- leading?: ReactNode
- /** Toggle rows (multi-select facets) announce their state. */
- pressed?: boolean
onClick: () => void
trailing?: ReactNode
}
@@ -117,22 +112,19 @@ export const OverlayNavItem = memo(function OverlayNavItem({
label,
nested,
onClick,
- leading,
- pressed,
trailing
}: OverlayNavItemProps) {
return (
<button
aria-current={current ? 'page' : undefined}
- aria-pressed={pressed}
className={cn(
- 'row-hover flex h-7 w-full shrink-0 items-center justify-start gap-2 rounded-md border px-2 text-left text-[length:var(--conversation-text-font-size)] font-normal transition-colors',
+ 'flex h-7 w-full items-center justify-start gap-2 rounded-md border px-2 text-left text-[length:var(--conversation-text-font-size)] font-normal transition-colors',
nested
? active
- ? 'border-transparent bg-(--ui-row-active-background) font-medium text-foreground'
+ ? 'border-transparent bg-(--chrome-action-hover) font-medium text-foreground'
: 'border-transparent bg-transparent text-(--ui-text-tertiary) hover:bg-(--chrome-action-hover) hover:text-foreground'
: active
- ? 'border-(--ui-stroke-tertiary) bg-(--ui-row-active-background) text-foreground'
+ ? 'border-(--ui-stroke-tertiary) bg-(--ui-bg-tertiary) text-foreground'
: 'border-transparent bg-transparent text-(--ui-text-secondary) hover:bg-(--chrome-action-hover) hover:text-foreground'
)}
// Names the row by its own id, so a tour can address one link
@@ -141,16 +133,13 @@ export const OverlayNavItem = memo(function OverlayNavItem({
onClick={onClick}
type="button"
>
- {leading}
- {Icon && (
- <Icon
- className={cn(
- 'shrink-0',
- nested ? 'size-3.5' : 'size-4',
- active ? 'text-foreground/80' : 'text-muted-foreground/80'
- )}
- />
- )}
+ <Icon
+ className={cn(
+ 'shrink-0',
+ nested ? 'size-3.5' : 'size-4',
+ active ? 'text-foreground/80' : 'text-muted-foreground/80'
+ )}
+ />
<span className="min-w-0 flex-1 truncate">{label}</span>
{trailing}
</button>
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 70bd96b131d..f5a7e614e7d 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, $profiles } from '@/store/profile'
import { $connection, $gatewayState } from '@/store/session'
-import { PluginActions } from '../capabilities/plugins/plugins-tab'
+import { PluginsTab } from '../capabilities/plugins/plugins-tab'
import { PluginInstallModal } from './plugin-install-modal'
@@ -38,7 +38,7 @@ const renderFlow = () =>
render(
<MemoryRouter initialEntries={['/capabilities?tab=plugins']}>
<QueryClientProvider client={queryClient}>
- <PluginActions profile={null} />
+ <PluginsTab profile={null} />
<PluginInstallModal />
</QueryClientProvider>
</MemoryRouter>
diff --git a/apps/desktop/src/app/shell/sidebar-label.tsx b/apps/desktop/src/app/shell/sidebar-label.tsx
index 6fa727b036f..759bae1d5c6 100644
--- a/apps/desktop/src/app/shell/sidebar-label.tsx
+++ b/apps/desktop/src/app/shell/sidebar-label.tsx
@@ -4,10 +4,9 @@ import { cn } from '@/lib/utils'
interface SidebarPanelLabelProps extends React.ComponentProps<'span'> {
dotClassName?: string
- meta?: React.ReactNode
}
-export function SidebarPanelLabel({ children, className, dotClassName, meta, ...props }: SidebarPanelLabelProps) {
+export function SidebarPanelLabel({ children, className, dotClassName, ...props }: SidebarPanelLabelProps) {
return (
<span
className={cn(
@@ -18,11 +17,6 @@ export function SidebarPanelLabel({ children, className, dotClassName, meta, ...
>
<span aria-hidden="true" className={cn('dither inline-block size-2 shrink-0 rounded-[1px]', dotClassName)} />
<span className="min-w-0 truncate leading-none">{children}</span>
- {meta && (
- <span className="shrink-0 text-[0.6875rem] font-medium tracking-normal text-(--ui-text-quaternary)">
- {meta}
- </span>
- )}
</span>
)
}
diff --git a/apps/desktop/src/components/confirm-host.test.tsx b/apps/desktop/src/components/confirm-host.test.tsx
index 99aee7e4fd5..0aeff59273e 100644
--- a/apps/desktop/src/components/confirm-host.test.tsx
+++ b/apps/desktop/src/components/confirm-host.test.tsx
@@ -64,45 +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/button.tsx b/apps/desktop/src/components/ui/button.tsx
index c786df58be6..97fe05a7403 100644
--- a/apps/desktop/src/components/ui/button.tsx
+++ b/apps/desktop/src/components/ui/button.tsx
@@ -25,9 +25,6 @@ const buttonVariants = cva(
// Soft-fill action (the default "non-primary button" look).
secondary:
'bg-(--ui-bg-quaternary) text-(--ui-text-primary) hover:bg-(--chrome-action-hover) hover:text-(--ui-text-primary)',
- // Clickable tag/filter chip — the soft fill plus a hairline inset ring on
- // hover (shadow, not border, so nothing reflows).
- chip: 'bg-(--ui-bg-quaternary) text-(--ui-text-primary) hover:bg-(--chrome-action-hover) hover:shadow-[inset_0_0_0_0.5px_var(--ui-stroke-secondary)]',
ghost: 'text-(--ui-text-secondary) hover:bg-(--chrome-action-hover) hover:text-(--ui-text-primary)',
grip: 'bg-transparent text-(--ui-text-tertiary) transition-colors hover:text-(--ui-text-secondary) focus-visible:text-(--ui-text-primary)',
// A control floating free of any surface (fan-menu discs, detached
diff --git a/apps/desktop/src/components/ui/checkbox.tsx b/apps/desktop/src/components/ui/checkbox.tsx
index 19666fcde5b..31c8e356586 100644
--- a/apps/desktop/src/components/ui/checkbox.tsx
+++ b/apps/desktop/src/components/ui/checkbox.tsx
@@ -4,15 +4,11 @@ import * as React from 'react'
import { Codicon } from '@/components/ui/codicon'
import { cn } from '@/lib/utils'
-const BOX =
- 'group peer size-4 shrink-0 rounded-sm border border-input shadow-xs outline-none transition-shadow data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground'
-
function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
return (
<CheckboxPrimitive.Root
className={cn(
- BOX,
- 'focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40',
+ 'group peer size-4 shrink-0 rounded-sm border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40',
className
)}
data-slot="checkbox"
@@ -31,19 +27,4 @@ function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxP
)
}
-/** The Checkbox look without a control, for rows that are themselves the toggle
- * (a real Checkbox is a button and can't nest inside one). */
-function CheckboxMark({ checked, className }: { checked: boolean; className?: string }) {
- return (
- <span
- aria-hidden
- className={cn(BOX, 'grid place-items-center', className)}
- data-slot="checkbox-mark"
- data-state={checked ? 'checked' : 'unchecked'}
- >
- {checked && <Codicon name="check" size="0.875rem" />}
- </span>
- )
-}
-
-export { Checkbox, CheckboxMark }
+export { Checkbox }
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/components/ui/masonry.css b/apps/desktop/src/components/ui/masonry.css
deleted file mode 100644
index 085e6e952e1..00000000000
--- a/apps/desktop/src/components/ui/masonry.css
+++ /dev/null
@@ -1,21 +0,0 @@
-.masonry {
- position: relative;
- display: grid;
- grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--masonry-min-width, 17rem)), 1fr));
- align-items: start;
- gap: calc(var(--spacing) * 3);
-}
-
-.masonry > [data-slot='masonry-item'] {
- min-width: 0;
-}
-
-.masonry[data-measured] > [data-slot='masonry-item'] {
- position: absolute;
-}
-
-@supports (display: grid-lanes) {
- .masonry {
- display: grid-lanes;
- }
-}
diff --git a/apps/desktop/src/components/ui/masonry.tsx b/apps/desktop/src/components/ui/masonry.tsx
deleted file mode 100644
index b2a2088a33f..00000000000
--- a/apps/desktop/src/components/ui/masonry.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-import './masonry.css'
-
-import { Children, type ComponentProps, useLayoutEffect, useRef } from 'react'
-
-import { cn } from '@/lib/utils'
-
-/** Native grid lanes when available; measured lanes for older Electron releases.
- * Children stay in source order and never move between React parents. */
-export function Masonry({ children, className, ...props }: ComponentProps<'div'>) {
- const root = useRef<HTMLDivElement>(null)
-
- useLayoutEffect(() => {
- const node = root.current
-
- if (!node || CSS.supports('display', 'grid-lanes')) {
- return
- }
-
- const items = Array.from(node.children) as HTMLElement[]
- let frame = 0
- let disposed = false
-
- const layout = () => {
- frame = 0
-
- if (disposed || !node.clientWidth) {
- return
- }
-
- const style = getComputedStyle(node)
- const tracks = style.gridTemplateColumns.split(' ').map(Number.parseFloat)
-
- if (!tracks.length || tracks.some(width => !Number.isFinite(width))) {
- return
- }
-
- const gap = Number.parseFloat(style.columnGap) || 0
- const width = tracks[0]
- const widthValue = `${width}px`
-
- // Write widths together before measuring wrapping. No React state updates,
- // window resize listeners, or per-item read/write alternation.
- for (const item of items) {
- if (item.style.width !== widthValue) {
- item.style.width = widthValue
- }
- }
-
- const heights = items.map(item => item.getBoundingClientRect().height)
- const lanes = tracks.map(() => 0)
-
- const placements = heights.map(height => {
- const lane = lanes.indexOf(Math.min(...lanes))
- const top = lanes[lane]
- lanes[lane] += height + gap
-
- return { top, left: lane * (width + gap) }
- })
-
- node.dataset.measured = ''
- items.forEach((item, index) => {
- item.style.insetInlineStart = `${placements[index].left}px`
- item.style.insetBlockStart = `${placements[index].top}px`
- })
- const height = `${Math.max(0, ...lanes) - (items.length ? gap : 0)}px`
-
- if (node.style.height !== height) {
- node.style.height = height
- }
- }
-
- const schedule = () => {
- if (!frame) {
- frame = requestAnimationFrame(layout)
- }
- }
-
- const observer = new ResizeObserver(schedule)
- observer.observe(node)
- items.forEach(item => observer.observe(item))
- layout()
-
- return () => {
- disposed = true
- observer.disconnect()
- cancelAnimationFrame(frame)
- delete node.dataset.measured
- node.style.removeProperty('height')
- items.forEach(item => {
- item.style.removeProperty('width')
- item.style.removeProperty('inset-inline-start')
- item.style.removeProperty('inset-block-start')
- })
- }
- }, [children])
-
- return (
- <div {...props} className={cn('masonry', className)} data-slot="masonry" ref={root}>
- {Children.map(children, child => child && <div data-slot="masonry-item">{child}</div>)}
- </div>
- )
-}
diff --git a/apps/desktop/src/components/ui/reel.tsx b/apps/desktop/src/components/ui/reel.tsx
deleted file mode 100644
index 4cbe595045e..00000000000
--- a/apps/desktop/src/components/ui/reel.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import type { ComponentProps } from 'react'
-
-import { cn } from '@/lib/utils'
-
-/** One row that scrolls sideways, snapping each child to the start edge.
- * Children keep their own width; set it from the caller (`*:w-68`). */
-export function Reel({ className, ...props }: ComponentProps<'div'>) {
- return (
- <div
- {...props}
- className={cn(
- 'flex snap-x snap-mandatory gap-3 overflow-x-auto overscroll-x-contain pb-2 *:shrink-0 *:snap-start',
- className
- )}
- data-slot="reel"
- />
- )
-}
diff --git a/apps/desktop/src/components/ui/search-field.tsx b/apps/desktop/src/components/ui/search-field.tsx
index c7e55632269..732118b1191 100644
--- a/apps/desktop/src/components/ui/search-field.tsx
+++ b/apps/desktop/src/components/ui/search-field.tsx
@@ -24,13 +24,6 @@ interface SearchFieldProps {
onKeyDown?: KeyboardEventHandler<HTMLInputElement>
inputRef?: RefObject<HTMLInputElement | null>
trailingAction?: ReactNode
- /**
- * `underline` (default) recedes into chrome — sidebars, page headers.
- * `box` is a standalone pill — visible stroke + quinary fill, the recipe
- * the Appearance theme search uses — for when search IS the page's primary
- * affordance, e.g. above a catalog grid.
- */
- variant?: 'underline' | 'box'
'aria-label'?: string
}
@@ -52,12 +45,10 @@ export function SearchField({
onKeyDown,
inputRef,
trailingAction,
- variant = 'underline',
'aria-label': ariaLabel
}: SearchFieldProps) {
const { t } = useI18n()
const clear = onClear ?? (() => onChange(''))
- const boxed = variant === 'box'
// One hint per mount, picked at random — fresh nudge every visit, no
// mid-page carousel.
@@ -71,18 +62,13 @@ export function SearchField({
// min-w-0 is load-bearing: without it the content-sized input sets the
// container's flex min-width and the field bulldozes its siblings
// instead of shrinking to fit its context.
- 'inline-flex min-w-0 max-w-full items-center gap-1.5 transition-[color,border-color,opacity]',
- boxed
- ? 'w-full gap-2 rounded-full border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) px-3.5 py-2 hover:border-(--ui-stroke-secondary) focus-within:border-(--ui-stroke-secondary)'
- : cn(
- 'border-b border-transparent px-0.5',
- // Recede until the user reaches for it.
- !value && 'opacity-30 focus-within:opacity-100'
- ),
+ 'inline-flex min-w-0 max-w-full items-center gap-1.5 border-b border-transparent px-0.5 transition-[color,border-color,opacity]',
+ // Recede until the user reaches for it.
+ !value && 'opacity-30 focus-within:opacity-100',
containerClassName
)}
>
- <Search className={cn('pointer-events-none shrink-0 text-muted-foreground/70', boxed ? 'size-4' : 'size-3.5')} />
+ <Search className="pointer-events-none size-3.5 shrink-0 text-muted-foreground/70" />
<input
aria-label={ariaLabel ?? placeholder}
className={cn(
@@ -94,9 +80,6 @@ export function SearchField({
// text (#119204). Long queries scroll inside the field.
// text-xs matches the form controls (Input/Select via controlVariants).
'h-7 min-w-0 max-w-full flex-1 bg-transparent text-xs text-foreground [field-sizing:content] placeholder:text-muted-foreground focus:outline-none',
- // Boxed: the wrapper owns the chrome, the input fills it (same as an
- // adorned Input).
- boxed && 'h-auto w-full flex-1 text-sm leading-5 [field-sizing:initial]',
inputClassName
)}
onChange={event => onChange(event.target.value)}
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index 4db6decd094..c7d64ce41e0 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -14,7 +14,6 @@ import { defineLocale } from './define-locale'
export const ar = defineLocale({
sharedMetrics: arCommon.sharedMetrics,
externalOpenFailed: arChrome.externalOpenFailed,
- catalog: arCapabilities.catalog,
sessionImport: arConnectors.sessionImport,
sendDiagnostics: arDiagnostics.sendDiagnostics,
common: arCommon.common,
diff --git a/apps/desktop/src/i18n/ar_capabilities.ts b/apps/desktop/src/i18n/ar_capabilities.ts
index 87db92f7561..df04c6695fd 100644
--- a/apps/desktop/src/i18n/ar_capabilities.ts
+++ b/apps/desktop/src/i18n/ar_capabilities.ts
@@ -1,65 +1,6 @@
import type { TranslationOverrides } from './define-locale'
export const arCapabilities = {
- catalog: {
- add: 'إضافة',
- added: 'تمت الإضافة',
- discover: 'اكتشف',
- featured: 'مميزة',
- explorePlugins: 'استكشف الإضافات',
- exploreSkills: 'استكشف المهارات',
- mostStarred: 'الأكثر حصولًا على نجوم',
- newest: 'الأحدث',
- recentlyUpdated: 'المحدثة مؤخرًا',
- alphabetical: 'الاسم',
- sortBy: 'ترتيب حسب',
- seeAll: 'عرض الكل',
- related: 'عناصر مشابهة',
- tags: 'الوسوم',
- screenshots: 'لقطات الشاشة',
- listView: 'عرض القائمة',
- cardView: 'عرض البطاقات',
- installTitle: (name: string) => `تثبيت «${name}»؟`,
- installDescription: 'ستتوفر هذه المهارة في الجلسات الجديدة. ثبّت من المصادر التي تثق بها فقط.',
- installTo: 'التثبيت في',
- thisComputer: 'هذا الكمبيوتر',
- installing: 'جارٍ التثبيت…',
- installComplete: (name: string) => `تم تثبيت «${name}»`,
- destinationChanged: 'تغيرت وجهة التثبيت. أغلق هذا الحوار وافتح رابط التثبيت مجددًا.',
- installed: 'المثبتة',
- searchSkills: 'البحث في المهارات',
- searchPlugins: 'البحث في الإضافات',
- allSources: 'كل المصادر',
- allCategories: 'كل الفئات',
- about: 'نبذة',
- author: 'المؤلف',
- source: 'المصدر',
- category: 'الفئة',
- version: 'الإصدار',
- platforms: 'المنصات',
- requires: 'المتطلبات',
- tools: 'الأدوات',
- hooks: 'الخطافات',
- middleware: 'البرمجيات الوسيطة',
- commands: 'الأوامر',
- license: 'الترخيص',
- addedDate: 'تاريخ الإضافة',
- updatedDate: 'تاريخ التحديث',
- repository: 'المستودع',
- documentation: 'التوثيق',
- noResults: 'لا توجد نتائج مطابقة',
- tryAnother: 'جرّب بحثًا آخر أو امسح عوامل التصفية.',
- clearFilters: 'مسح عوامل التصفية',
- filters: 'عوامل التصفية',
- loadFailed: 'تعذر تحميل الكتالوج',
- retry: 'حاول مرة أخرى',
- more: 'عرض المزيد',
- pinned: 'التزام تمت مراجعته',
- snapshotHint: 'من كتالوج Hermes. لا يتصل التصفح بمستودعات المصدر مطلقًا.',
- installHint: 'راجع المصدر قبل التثبيت. تسري التغييرات على الجلسات الجديدة.',
- results: (count: number) => `النتائج: ${count.toLocaleString('ar')}`,
- back: 'العودة إلى النتائج'
- },
skills: {
plugins: {
pageBlurb: 'يمكن للإضافة توسيع هذا التطبيق أو الوكيل أو كليهما — ولكل جزء مفتاح تشغيل مستقل.'
@@ -132,4 +73,4 @@ export const arCapabilities = {
durationMinutes: (minutes, seconds) => `${minutes} د ${seconds} ث`,
tokens: value => `${value} رمز`
}
-} satisfies Pick<TranslationOverrides, 'catalog' | 'skills' | 'agents'>
+} satisfies Pick<TranslationOverrides, 'skills' | 'agents'>
diff --git a/apps/desktop/src/i18n/backend-packs.test.ts b/apps/desktop/src/i18n/backend-packs.test.ts
index 25531c821b6..294d34238c8 100644
--- a/apps/desktop/src/i18n/backend-packs.test.ts
+++ b/apps/desktop/src/i18n/backend-packs.test.ts
@@ -42,7 +42,7 @@ describe('syncBackendLocalePacks', () => {
{ id: 'pl', endonym: 'Polski', rtl: false, source: 'plugin:hermes-lang-pl' }
]
},
- { pl: { 'common.save': 'Zapisz', 'catalog.results': '{0} wyników' } },
+ { pl: { 'common.save': 'Zapisz', 'connectorsPage.searchPlaceholder': '{0} wyników' } },
calls
)
@@ -52,7 +52,7 @@ describe('syncBackendLocalePacks', () => {
expect(isRegisteredLocale('pl')).toBe(true)
expect(languageOptions().find(option => option.id === 'pl')).toMatchObject({ endonym: 'Polski', source: 'backend' })
expect(resolveTranslations('pl').common.save).toBe('Zapisz')
- expect(resolveTranslations('pl').catalog.results(5)).toBe('5 wyników')
+ expect(resolveTranslations('pl').connectorsPage.searchPlaceholder(5)).toBe('5 wyników')
expect(resolveTranslations('pl').common.cancel).toBe(TRANSLATIONS.en.common.cancel)
})
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 63ca8f082a0..8df3f423f4c 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -50,65 +50,6 @@ export const en: Translations = {
},
// English editorial copy stays in the shipped JSONL; other locales override it.
intro: { stock: {}, custom: () => [] },
- catalog: {
- add: 'Add',
- added: 'Added',
- discover: 'Discover',
- featured: 'Featured',
- explorePlugins: 'Explore plugins',
- exploreSkills: 'Explore skills',
- mostStarred: 'Most starred',
- newest: 'Newest',
- recentlyUpdated: 'Recently updated',
- alphabetical: 'Name',
- sortBy: 'Sort by',
- seeAll: 'See all',
- related: 'More like this',
- tags: 'Tags',
- screenshots: 'Screenshots',
- listView: 'List view',
- cardView: 'Card view',
- installTitle: (name: string) => `Install “${name}”?`,
- installDescription: 'This skill will be available in new sessions. Only install sources you trust.',
- installTo: 'Install to',
- thisComputer: 'This computer',
- installing: 'Installing…',
- installComplete: (name: string) => `“${name}” installed`,
- destinationChanged: 'The destination changed. Close this dialog and open the install link again.',
- installed: 'Installed',
- 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',
- middleware: 'Middleware',
- commands: 'Commands',
- license: 'License',
- addedDate: 'Added',
- updatedDate: 'Updated',
- repository: 'Repository',
- documentation: 'Documentation',
- noResults: 'No matches',
- tryAnother: 'Try another search or clear your filters.',
- clearFilters: 'Clear filters',
- filters: '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 6e4f18b46b9..522dfaeb8fc 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -48,67 +48,6 @@ export const ja = defineLocale({
stripDetails: '詳細'
},
intro: introJa,
- catalog: {
- add: '追加',
- added: '追加済み',
- discover: '見つける',
- featured: 'おすすめ',
- explorePlugins: 'プラグインを探す',
- exploreSkills: 'スキルを探す',
- mostStarred: 'スターが多い順',
- newest: '新着',
- recentlyUpdated: '最近の更新',
- alphabetical: '名前',
- sortBy: '並べ替え',
- seeAll: 'すべて表示',
- related: '類似の項目',
- tags: 'タグ',
- screenshots: 'スクリーンショット',
- listView: 'リスト表示',
- cardView: 'カード表示',
- installTitle: (name: string) => `「${name}」をインストールしますか?`,
- installDescription:
- 'このスキルは新しいセッションで利用できます。信頼できる提供元からのみインストールしてください。',
- installTo: 'インストール先',
- thisComputer: 'このコンピューター',
- installing: 'インストール中…',
- installComplete: (name: string) => `「${name}」をインストールしました`,
- destinationChanged:
- 'インストール先が変更されました。このダイアログを閉じ、インストールリンクを開き直してください。',
- installed: 'インストール済み',
- searchSkills: 'スキルを検索',
- searchPlugins: 'プラグインを検索',
- allSources: 'すべての提供元',
- allCategories: 'すべてのカテゴリ',
- about: '概要',
- author: '作者',
- source: '提供元',
- category: 'カテゴリ',
- version: 'バージョン',
- platforms: '対応プラットフォーム',
- requires: '必要なもの',
- tools: 'ツール',
- hooks: 'フック',
- middleware: 'ミドルウェア',
- commands: 'コマンド',
- license: 'ライセンス',
- addedDate: '追加日',
- updatedDate: '更新日',
- repository: 'リポジトリ',
- documentation: 'ドキュメント',
- noResults: '一致する項目がありません',
- tryAnother: '別の検索を試すか、フィルターをクリアしてください。',
- clearFilters: 'フィルターをクリア',
- filters: 'フィルター',
- 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/registry.test.ts b/apps/desktop/src/i18n/registry.test.ts
index e16f48ee0fc..13a300169df 100644
--- a/apps/desktop/src/i18n/registry.test.ts
+++ b/apps/desktop/src/i18n/registry.test.ts
@@ -40,14 +40,17 @@ describe('registerAppLocale', () => {
it('wraps a pack string over a function-valued English entry into a positional formatter', () => {
registerAppLocale('pl', {
- translations: { 'catalog.results': '{0} wyników', 'connectorsPage.card.fact.toolsSomeOn': '{1} z {0} narzędzi' }
+ translations: {
+ 'connectorsPage.searchPlaceholder': '{0} wyników',
+ 'connectorsPage.card.fact.toolsSomeOn': '{1} z {0} narzędzi'
+ }
})
const pl = resolveTranslations('pl')
- expect(pl.catalog.results(3)).toBe('3 wyników')
+ expect(pl.connectorsPage.searchPlaceholder(3)).toBe('3 wyników')
expect(pl.connectorsPage.card.fact.toolsSomeOn(10, 4)).toBe('4 z 10 narzędzi')
- expect(typeof pl.catalog.installTitle).toBe('function')
+ expect(typeof pl.connectorsPage.card.fact.toolsSomeOn).toBe('function')
})
it('keeps dotted leaf keys (keybinds.actions) addressable from a flat pack', () => {
@@ -176,6 +179,8 @@ describe('translateNow', () => {
registerAppLocale('en', { translations: { common: { save: 'Keep' } } }, 'backend')
expect(translateNow('common.save')).toBe('Keep')
- expect(translateNow('catalog.results', 2)).toBe(TRANSLATIONS.en.catalog.results(2))
+ expect(translateNow('connectorsPage.searchPlaceholder', 2)).toBe(
+ TRANSLATIONS.en.connectorsPage.searchPlaceholder(2)
+ )
})
})
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index e21bca4763d..c0820946c60 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -60,66 +60,6 @@ export const ru = defineLocale({
stripChoices: { share: 'Отправлять в Nous', local: 'Только локально', off: 'Нет, спасибо' },
stripDetails: 'Подробнее'
},
- catalog: {
- add: 'Добавить',
- added: 'Добавлено',
- discover: 'Открывайте новое',
- featured: 'Рекомендуемые',
- explorePlugins: 'Обзор плагинов',
- exploreSkills: 'Обзор навыков',
- mostStarred: 'Больше всего звёзд',
- newest: 'Новинки',
- recentlyUpdated: 'Недавно обновлённые',
- alphabetical: 'Название',
- sortBy: 'Сортировать по',
- seeAll: 'Показать все',
- related: 'Похожие',
- tags: 'Теги',
- screenshots: 'Снимки экрана',
- listView: 'Список',
- cardView: 'Карточки',
- installTitle: (name: string) => `Установить «${name}»?`,
- installDescription: 'Навык будет доступен в новых сессиях. Устанавливайте только из источников, которым доверяете.',
- installTo: 'Установить в',
- thisComputer: 'Этот компьютер',
- installing: 'Установка…',
- installComplete: (name: string) => `«${name}» установлен`,
- destinationChanged: 'Место установки изменилось. Закройте диалог и снова откройте ссылку установки.',
- installed: 'Установленные',
- searchSkills: 'Поиск навыков',
- searchPlugins: 'Поиск плагинов',
- allSources: 'Все источники',
- allCategories: 'Все категории',
- about: 'Описание',
- author: 'Автор',
- source: 'Источник',
- category: 'Категория',
- version: 'Версия',
- platforms: 'Платформы',
- requires: 'Требования',
- tools: 'Инструменты',
- hooks: 'Хуки',
- middleware: 'Промежуточное ПО',
- commands: 'Команды',
- license: 'Лицензия',
- addedDate: 'Добавлено',
- updatedDate: 'Обновлено',
- repository: 'Репозиторий',
- documentation: 'Документация',
- noResults: 'Совпадений нет',
- tryAnother: 'Попробуйте другой запрос или сбросьте фильтры.',
- clearFilters: 'Сбросить фильтры',
- filters: 'Фильтры',
- 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 76d1efcedee..53f4dd18cbf 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -110,65 +110,6 @@ export interface Translations {
stock: Record<string, string[]>
custom: (label: string) => string[]
}
- catalog: {
- add: string
- added: string
- discover: string
- featured: string
- explorePlugins: string
- exploreSkills: string
- mostStarred: string
- newest: string
- recentlyUpdated: string
- alphabetical: string
- sortBy: string
- seeAll: string
- related: string
- tags: string
- screenshots: string
- listView: string
- cardView: string
- installTitle: (name: string) => string
- installDescription: string
- installTo: string
- thisComputer: string
- installing: string
- installComplete: (name: string) => string
- destinationChanged: 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
- middleware: string
- commands: string
- license: string
- addedDate: string
- updatedDate: string
- repository: string
- documentation: string
- noResults: string
- tryAnother: string
- clearFilters: string
- filters: 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 6a16a447ff2..8533714ca43 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -54,65 +54,6 @@ export const zhHant = defineLocale({
stripDetails: '詳細資訊'
},
intro: introZhHant,
- catalog: {
- add: '新增',
- added: '已新增',
- discover: '探索',
- featured: '精選',
- explorePlugins: '探索外掛',
- exploreSkills: '探索技能',
- mostStarred: '星標最多',
- newest: '最新發布',
- recentlyUpdated: '最近更新',
- alphabetical: '名稱',
- sortBy: '排序方式',
- seeAll: '查看全部',
- related: '類似推薦',
- tags: '標籤',
- screenshots: '螢幕截圖',
- listView: '清單檢視',
- cardView: '卡片檢視',
- installTitle: (name: string) => `安裝「${name}」?`,
- installDescription: '此技能將於新的工作階段中可用。請僅安裝可信來源的內容。',
- installTo: '安裝至',
- thisComputer: '這部電腦',
- installing: '正在安裝…',
- installComplete: (name: string) => `已安裝「${name}」`,
- destinationChanged: '安裝目標已變更。請關閉此對話框並重新開啟安裝連結。',
- installed: '已安裝',
- searchSkills: '搜尋技能',
- searchPlugins: '搜尋外掛',
- allSources: '所有來源',
- allCategories: '所有分類',
- about: '簡介',
- author: '作者',
- source: '來源',
- category: '分類',
- version: '版本',
- platforms: '支援的平台',
- requires: '相依項目',
- tools: '工具',
- hooks: '掛鉤',
- middleware: '中介軟體',
- commands: '指令',
- license: '授權條款',
- addedDate: '新增日期',
- updatedDate: '更新日期',
- repository: '程式碼儲存庫',
- documentation: '文件',
- noResults: '沒有符合的項目',
- tryAnother: '請嘗試其他搜尋或清除篩選條件。',
- clearFilters: '清除篩選條件',
- filters: '篩選條件',
- loadFailed: '無法載入目錄',
- retry: '再試一次',
- more: '顯示更多',
- pinned: '已審核的提交',
- snapshotHint: '內容來自 Hermes 目錄。瀏覽時不會連線至來源程式碼儲存庫。',
- installHint: '安裝前請檢查原始碼。變更將於新的工作階段生效。',
- results: (count: number) => `${count.toLocaleString('zh-Hant')} 個結果`,
- back: '返回結果'
- },
sessionImport: zhHantConnectors.sessionImport,
common: zhHantCommon.common,
fileMenu: zhHantChrome.fileMenu,
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index b445a2991a7..20e9ce0cf5e 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -45,65 +45,6 @@ export const zh = defineLocale({
stripDetails: '详情'
},
intro: introZh,
- catalog: {
- add: '添加',
- added: '已添加',
- discover: '发现',
- featured: '精选',
- explorePlugins: '探索插件',
- exploreSkills: '探索技能',
- mostStarred: '星标最多',
- newest: '最新发布',
- recentlyUpdated: '最近更新',
- alphabetical: '名称',
- sortBy: '排序方式',
- seeAll: '查看全部',
- related: '类似推荐',
- tags: '标签',
- screenshots: '截图',
- listView: '列表视图',
- cardView: '卡片视图',
- installTitle: (name: string) => `安装“${name}”?`,
- installDescription: '此技能将在新会话中可用。请仅安装可信来源的内容。',
- installTo: '安装到',
- thisComputer: '此电脑',
- installing: '正在安装…',
- installComplete: (name: string) => `已安装“${name}”`,
- destinationChanged: '安装目标已更改。请关闭此对话框并重新打开安装链接。',
- installed: '已安装',
- searchSkills: '搜索技能',
- searchPlugins: '搜索插件',
- allSources: '所有来源',
- allCategories: '所有分类',
- about: '简介',
- author: '作者',
- source: '来源',
- category: '分类',
- version: '版本',
- platforms: '支持的平台',
- requires: '依赖项',
- tools: '工具',
- hooks: '钩子',
- middleware: '中间件',
- commands: '命令',
- license: '许可证',
- addedDate: '添加日期',
- updatedDate: '更新日期',
- repository: '代码仓库',
- documentation: '文档',
- noResults: '没有匹配项',
- tryAnother: '请尝试其他搜索或清除筛选条件。',
- clearFilters: '清除筛选条件',
- filters: '筛选条件',
- 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 0395b9e38c9..00000000000
--- a/apps/desktop/src/lib/catalog-install.test.ts
+++ /dev/null
@@ -1,53 +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('routes only the canonical catalog name through the reviewed lookup', () => {
- const plugin = {
- name: 'weather',
- repo: 'https://github.com/owner/plugins',
- subdir: 'packages/weather',
- sha: 'a'.repeat(40)
- }
-
- expect(route(pluginCatalogInstallUrl(plugin))).toEqual({
- type: 'plugin-catalog-install',
- name: plugin.name
- })
- expect([...new URL(pluginCatalogInstallUrl(plugin)).searchParams]).toEqual([['catalog', plugin.name]])
- })
-})
diff --git a/apps/desktop/src/lib/deeplink-routes.test.ts b/apps/desktop/src/lib/deeplink-routes.test.ts
index 9742789918f..ace1834ef96 100644
--- a/apps/desktop/src/lib/deeplink-routes.test.ts
+++ b/apps/desktop/src/lib/deeplink-routes.test.ts
@@ -39,31 +39,6 @@ describe('resolveDeepLinkAction', () => {
).toEqual({ type: 'plugin-catalog-install', name: '' })
})
- it('does not trust URL catalog metadata on a repository install', () => {
- const params = {
- repo: 'https://github.com/owner/repo#plugins/example',
- catalog_name: 'example',
- sha: '0123456789abcdef0123456789abcdef01234567',
- enable: '1'
- }
-
- const url = new URL(`hermes://plugin/install?${new URLSearchParams(params)}`)
-
- expect(
- resolveDeepLinkAction({
- kind: url.hostname,
- name: url.pathname.slice(1),
- params: Object.fromEntries(url.searchParams)
- })
- ).toEqual({
- type: 'plugin-install',
- repo: params.repo,
- enable: true,
- force: false,
- legacyHint: null
- })
- })
-
it('routes legacy plugin-agent alias', () => {
expect(
resolveDeepLinkAction({
@@ -74,50 +49,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('preserves connector completion routing without treating browser status as authority', () => {
- expect(
- resolveDeepLinkAction({
- kind: 'connections',
- name: 'done',
- params: { op: ' operation-1 ', status: ' connected ' }
- })
- ).toEqual({ type: 'connection-done', op: 'operation-1', status: 'connected' })
- expect(
- resolveDeepLinkAction({
- kind: 'connections',
- name: 'done',
- params: { status: 'connected' }
- })
- ).toEqual({ type: 'ignore' })
- })
-
it('routes blueprint composer inserts', () => {
expect(
resolveDeepLinkAction({
diff --git a/apps/desktop/src/lib/deeplink-routes.ts b/apps/desktop/src/lib/deeplink-routes.ts
index 158254050ea..547728b5657 100644
--- a/apps/desktop/src/lib/deeplink-routes.ts
+++ b/apps/desktop/src/lib/deeplink-routes.ts
@@ -11,7 +11,6 @@ export type DeepLinkAction =
/** `hermes://plugin/install?catalog=<name>` — resolved against the curated
* catalog by the caller; the raw name is never treated as a git identifier. */
| { type: 'plugin-catalog-install'; name: string }
- | { type: 'skill-install'; identifier: string }
| { type: 'composer-blueprint'; name: string; params: Record<string, string> }
| { type: 'connection-done'; op: string; status: string }
| { type: 'ignore' }
@@ -51,20 +50,7 @@ export function resolveDeepLinkAction(payload: DeepLinkPayload | null | undefine
return { type: 'plugin-catalog-install', name: payload.params.catalog.trim() }
}
- if (payload.kind === 'skill') {
- const identifier = payload.params?.identifier
-
- return payload.name === 'install' && identifier && identifier === identifier.trim()
- ? { type: 'skill-install', identifier }
- : { type: 'ignore' }
- }
-
- const repo = (
- payload.params?.repo ||
- payload.params?.identifier ||
- (payload.kind !== 'plugin' ? payload.name : '') ||
- ''
- ).trim()
+ const repo = (payload.params?.repo || payload.params?.identifier || payload.name || '').trim()
if (payload.kind === 'plugin' && payload.name === 'install' && repo) {
return {
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 99c50ea5a4c..00000000000
--- a/apps/desktop/src/store/skill-deeplink-install.test.ts
+++ /dev/null
@@ -1,105 +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 51c8d2e9523..00000000000
--- a/apps/desktop/src/store/skill-deeplink-install.ts
+++ /dev/null
@@ -1,64 +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/desktop/vitest.setup.ts b/apps/desktop/vitest.setup.ts
index 4d322b49ebb..d245e110dfc 100644
--- a/apps/desktop/vitest.setup.ts
+++ b/apps/desktop/vitest.setup.ts
@@ -2,7 +2,7 @@ import { configure } from '@testing-library/react'
import { InertResizeObserver } from './src/test/jsdom'
-// Shared tooltips measure their arrow through Radix's useSize hook; Masonry measures lanes.
+// Shared tooltips measure their arrow through Radix's useSize hook.
// Geometry assertions still belong in a real browser, not this inert observer. Assigned,
// not `vi.stubGlobal`, so a test's `vi.unstubAllGlobals()` cannot strip it.
globalThis.ResizeObserver ??= InertResizeObserver as unknown as typeof ResizeObserver
@@ -51,7 +51,7 @@ globalThis.IntersectionObserver = class {
}
} as typeof IntersectionObserver
-// Idle prefetches and feature queries (Masonry's `CSS.supports`) run on mount.
+// Idle prefetches and feature queries (`CSS.supports`) run on mount.
// jsdom has neither API; idle work never fires and every feature reads as absent.
globalThis.requestIdleCallback ??= () => 0
globalThis.cancelIdleCallback ??= () => undefined
diff --git a/apps/shared/src/catalog-browse.ts b/apps/shared/src/catalog-browse.ts
deleted file mode 100644
index 43dafea8d00..00000000000
--- a/apps/shared/src/catalog-browse.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/** Shared with the docs catalog: taxonomy order is independent of popularity. Keep keys in sync
- * with CATALOG_CATEGORIES in hermes_cli/plugin_catalog.py and website/scripts/extract-plugins.py. */
-export const PLUGIN_CATEGORIES: Record<string, { label: string; icon: string; blurb: string }> = {
- desktop: { label: 'Desktop', icon: '🖥️', blurb: 'Panes, tabs and views for Hermes Desktop' },
- memory: { label: 'Memory', icon: '🧠', blurb: 'Memory providers and context engines' },
- platform: { label: 'Platforms', icon: '💬', blurb: 'Messaging and channel adapters' },
- web: { label: 'Web & Browser', icon: '🌐', blurb: 'Search backends, extraction and browser control' },
- tools: { label: 'Tools', icon: '🛠️', blurb: 'New tools the agent can call' },
- voice: { label: 'Voice', icon: '🎙️', blurb: 'Speech, TTS and realtime audio' },
- automation: { label: 'Automation', icon: '⏱️', blurb: 'Hooks, wake triggers and session automation' },
- models: { label: 'Models', icon: '✨', blurb: 'Model and inference providers' },
- general: { label: 'General', icon: '📦', blurb: 'Plugins that span several areas' }
-}
-
-export const PLUGIN_CATEGORY_ORDER = Object.keys(PLUGIN_CATEGORIES)
-export type PluginCatalogSort = 'stars' | 'newest' | 'updated'
-
-export function sortCatalogPlugins<T extends { name: string; addedAt?: string | null; updatedAt?: string | null }>(entries: T[], sort: PluginCatalogSort): T[] {
- // The published snapshot already sorts stars descending, then name. Preserve
- // its order, including ties, rather than reinterpreting missing star counts.
- if (sort === 'stars') { return entries }
- const field = sort === 'newest' ? 'addedAt' : 'updatedAt'
-
- const date = (value?: string | null) => {
- const ms = value ? Date.parse(value) : NaN
-
- return Number.isFinite(ms) ? ms : -Infinity
- }
-
- return [...entries].sort((a, b) => date(b[field]) - date(a[field]) || a.name.localeCompare(b.name))
-}
-
-export function groupCatalogPlugins<T extends { category: string }>(entries: T[]): [string, T[]][] {
- const buckets = new Map<string, T[]>()
-
- for (const entry of entries) {
- const key = Object.hasOwn(PLUGIN_CATEGORIES, entry.category) ? entry.category : 'general'
- const bucket = buckets.get(key) ?? []
- bucket.push(entry)
- buckets.set(key, bucket)
- }
-
- return PLUGIN_CATEGORY_ORDER.filter(key => buckets.has(key)).map(key => [key, buckets.get(key)!])
-}
diff --git a/apps/shared/src/catalog-install.ts b/apps/shared/src/catalog-install.ts
deleted file mode 100644
index 451cc24ebd7..00000000000
--- a/apps/shared/src/catalog-install.ts
+++ /dev/null
@@ -1,35 +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 }): string {
- return `hermes://plugin/install?${new URLSearchParams({ catalog: plugin.name })}`
-}
diff --git a/apps/shared/src/index.ts b/apps/shared/src/index.ts
index 35ddac34f61..2d9f359534d 100644
--- a/apps/shared/src/index.ts
+++ b/apps/shared/src/index.ts
@@ -27,8 +27,6 @@ export type {
UsageBarData,
UsageModelData
} from './billing-types'
-export { groupCatalogPlugins, PLUGIN_CATEGORIES, PLUGIN_CATEGORY_ORDER, sortCatalogPlugins } from './catalog-browse'
-export { pluginCatalogInstallUrl, skillCatalogInstallIdentifier, skillCatalogInstallUrl } from './catalog-install'
export {
driveChargeSettlement,
SETTLEMENT_MAX_RETRY_AFTER_MS,
diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.json
index 9cb5a073e70..79ee81b2ca8 100644
--- a/locales/_keys.desktop.json
+++ b/locales/_keys.desktop.json
@@ -496,63 +496,6 @@
"boot.steps.retryingRemoteBackend",
"boot.steps.startingDesktopConnection",
"boot.steps.startingHermesDesktop",
- "catalog.about",
- "catalog.add",
- "catalog.added",
- "catalog.addedDate",
- "catalog.allCategories",
- "catalog.allSources",
- "catalog.alphabetical",
- "catalog.author",
- "catalog.back",
- "catalog.cardView",
- "catalog.category",
- "catalog.clearFilters",
- "catalog.commands",
- "catalog.destinationChanged",
- "catalog.discover",
- "catalog.documentation",
- "catalog.explorePlugins",
- "catalog.exploreSkills",
- "catalog.featured",
- "catalog.filters",
- "catalog.hooks",
- "catalog.installComplete",
- "catalog.installDescription",
- "catalog.installHint",
- "catalog.installTitle",
- "catalog.installTo",
- "catalog.installed",
- "catalog.installing",
- "catalog.license",
- "catalog.listView",
- "catalog.loadFailed",
- "catalog.middleware",
- "catalog.more",
- "catalog.mostStarred",
- "catalog.newest",
- "catalog.noResults",
- "catalog.pinned",
- "catalog.platforms",
- "catalog.recentlyUpdated",
- "catalog.related",
- "catalog.repository",
- "catalog.requires",
- "catalog.results",
- "catalog.retry",
- "catalog.screenshots",
- "catalog.searchPlugins",
- "catalog.searchSkills",
- "catalog.seeAll",
- "catalog.snapshotHint",
- "catalog.sortBy",
- "catalog.source",
- "catalog.tags",
- "catalog.thisComputer",
- "catalog.tools",
- "catalog.tryAnother",
- "catalog.updatedDate",
- "catalog.version",
"commandCenter.actionDone",
"commandCenter.actionFailed",
"commandCenter.actionRunning",
diff --git a/tests/website/test_extract_skills.py b/tests/website/test_extract_skills.py
index 0b946fc1ddf..181a3dbabda 100644
--- a/tests/website/test_extract_skills.py
+++ b/tests/website/test_extract_skills.py
@@ -17,7 +17,6 @@ per-skill source links and a cleaned-up category sidebar:
from __future__ import annotations
import importlib.util
-import json
from pathlib import Path
import pytest
@@ -35,42 +34,6 @@ def mod():
return module
[email protected]("directory,source,prefix", [
- ("skills", "built-in", "NousResearch/hermes-agent/skills"),
- ("optional-skills", "optional", "official"),
-])
-def test_local_skills_publish_exact_install_target(mod, tmp_path, monkeypatch, directory, source, prefix):
- skill = tmp_path / directory / "creative" / "nested" / "example"
- skill.mkdir(parents=True)
- (skill / "SKILL.md").write_text("---\nname: Different Display Name\n---\nExample.")
- monkeypatch.setattr(mod, "REPO_ROOT", str(tmp_path))
- [entry] = mod.extract_local_skills()
- expected = f"{prefix}/creative/nested/example"
- assert entry["installIdentifier"] == expected
- assert entry["installCmd"] == f"hermes skills install {expected}"
-
-
-def test_unified_skills_keep_source_identifiers_and_match_cli_install_targets(mod, tmp_path, monkeypatch):
- entries = [
- {"source": "clawhub", "identifier": "apple-design", "name": "Display name"},
- {"source": "skills-sh", "identifier": "skills-sh/owner/repo/a skill?mode=one&two#readme"},
- {"source": "github", "identifier": "anthropics/skills/skills/pdf"},
- {"source": "well-known", "identifier": "https://example.com/skills/example"},
- ]
- index = tmp_path / "skills-index.json"
- index.write_text(json.dumps({"skills": entries}))
- monkeypatch.setattr(mod, "UNIFIED_INDEX_PATH", str(index))
- extracted, _ = mod.extract_unified_index_skills()
-
- assert len(extracted) == len(entries)
- for source, published in zip(entries, extracted):
- identifier = source["identifier"]
- expected = f"clawhub/{identifier}" if source["source"] == "clawhub" else identifier
- assert published["identifier"] == identifier
- assert published["installIdentifier"] == expected
- assert published["installCmd"] == f"hermes skills install {expected}"
-
-
# --------------------------------------------------------------------------
# _source_url
# --------------------------------------------------------------------------
diff --git a/website/docs/user-guide/desktop.md b/website/docs/user-guide/desktop.md
index 55bebc20115..ce9a0320e81 100644
--- a/website/docs/user-guide/desktop.md
+++ b/website/docs/user-guide/desktop.md
@@ -272,39 +272,13 @@ When you have two or more [profiles](./profiles.md), the config-backed settings
The app also surfaces the broader Hermes management surface so you don't have to drop to a terminal:
-- **Skills** — open **Capabilities → Skills** to manage [skills](./features/skills.md). **Installed** shows the selected profile's actual skills and enable/disable state. **Browse** searches the same full published catalog as the public Skills Hub, with native cards and details.
-- **Plugins** — **Capabilities → Plugins** uses the same **Installed / Browse** layout. Installed combines actual app-level desktop plugins with agent plugins from the selected profile; Browse shows the public [Plugin Catalog](./features/plugin-catalog.md). Search stays at the top, and the tab switch and actions share one row on both pages.
+- **Skills** — browse, install, and manage [skills](./features/skills.md). The Skills tab lists your installed skills with enable/disable toggles, and below them the full built-in optional-skills catalog that ships with Hermes — each entry has a one-click **Install** button that flips the row into the installed list once it finishes.
- **Memory graph (Star Map)** — type `/journey` (aliases `/learning`, `/memory-graph`) in chat to open an interactive constellation of learned skills and memories over time, with a playback scrubber. Nodes can be edited or deleted right from the panel (skills are archived, memories removed). See [Learning Journey](./features/memory.md#learning-journey-journey).
- **Cron** — view and manage [scheduled jobs](../reference/cli-commands.md#hermes-cron). With **All profiles** on, the list aggregates every profile's jobs; a job's run history and actions (pause, resume, edit, delete) always go to the profile that owns the job, whichever profile is active.
- **Profiles** — switch between [Hermes profiles](./profiles.md) (isolated config/skills/sessions).
- **Messaging** — set up gateway channels. Telegram has a **Quick setup** card: click **Create with QR**, scan the code (or open the link) in Telegram, and Hermes creates the bot, detects your user ID for the allowlist, saves the credentials, and restarts the gateway for you. Any credential save, clear, or enable toggle keeps a **Restart now** banner on the page until the gateway has actually restarted; if a restart fails, the banner stays so you can retry or restart manually.
- **Agents** and **Command Center** — orchestration surfaces for multi-agent work.
-#### Where Browse gets its data
-
-These are native Desktop views, **not embedded website pages**. Desktop and
-the public website consume the same generated CDN snapshots:
-
-| Catalog | Public docs alias | Desktop fetch URL |
-|---|---|---|
-| Skills | [`/docs/api/skills.json`](https://hermes-agent.nousresearch.com/docs/api/skills.json) | `https://nousresearch.github.io/hermes-agent/docs/api/skills.json` |
-| Plugins | [`/docs/api/plugins.json`](https://hermes-agent.nousresearch.com/docs/api/plugins.json) | `https://nousresearch.github.io/hermes-agent/docs/api/plugins.json` |
-
-The skills snapshot combines `skills/`, `optional-skills/`, and the centralized
-skills index. The plugin snapshot comes from `plugin-catalog/*.yaml` and cached star
-counts; the same publish supplies the installer's removed-entry list. Browsing does not make live
-GitHub API calls or fetch plugin/skill source repositories. **Installed** is
-separate: its state comes from the selected profile's backend and the app's
-desktop-plugin registry, not those public snapshots.
-
-The public hubs' install buttons open `hermes://skill/install?identifier=...`
-or `hermes://plugin/install?catalog=...` links and require confirmation in Desktop.
-Use an updated Desktop build for these routes; the cards retain copyable CLI
-commands if the app is missing or too old. See
-[skill links](./features/skills.md#install-from-the-website) and
-[plugin links](./features/plugins.md#one-click-install-links-desktop) for the
-parameters and review flow.
-
### Bot Mode (built in)
**Bot Mode** ships with the app and is on by default: a "one chat per agent"
@@ -579,25 +553,25 @@ SHA-pinned) plus an import allowlist — not isolation. A plugin whose
row; **⌘K → Reload desktop plugins** re-reads every installed `plugin.js`,
including one an installer replaced in place.
-**Capabilities → Plugins → Installed** shows the actual installed state:
-**one list entry per plugin**, with Desktop and Agent controls in its detail pane.
+**Capabilities → Plugins** is the one place for everything that extends
+Hermes: **one row per plugin**, with two switch columns.
- A plugin can extend **this app**, **the agent**, or **both** — the badge on
each row says which, inferred from what the package contains (`plugin.yaml`
→ agent half, `plugin.js` → desktop half). A plugin with both halves is one
row, never two.
-- **Desktop control** — the half loaded into this app. It is app-level: the
+- **Desktop column** — the half loaded into this app. It is app-level: the
same switch, the same value, whichever profile, gateway, or remote machine
the window is looking at. Desktop code loads from exactly one place,
`~/.hermes/desktop-plugins/`; the desktop half of a unified agent+desktop
package is copied there by the app when the package is installed (and
follows its updates and uninstall), so switching profiles never loads,
unloads, or re-scopes a pane. Toggles apply live.
-- **Agent control** — the half installed in the selected profile's backend
+- **Agent column** — the half installed in the selected profile's backend
([agent plugins](./features/plugins.md): user, git, project, pip and
portable installs), with an **Update** chip when a catalog pin moved. The
- profile selector governs only the agent half; with a single profile there
- is no selector at all.
+ profile selector lives in this column's header because it governs only
+ this column; with a single profile there is no selector at all.
Repo-bundled built-ins (platform adapters, provider plugins) are not
listed: they ship enabled and are configured from their own surfaces. The
exceptions are the bundled lifecycle plugins with no surface of their own
@@ -622,14 +596,13 @@ including one an installer replaced in place.
button; confirming deletes that folder on this computer and unloads the
plugin immediately, no gateway involved.
-Switch to **Browse** for the native [Plugin Catalog](./features/plugin-catalog.md).
-Both Browse and **Install from Git** open the review-then-install dialog. For
-an agent-plugin catalog install, the backend resolves the catalog name to its
-reviewed pin. Website links carry only that name; Desktop looks up the reviewed
-repository and commit rather than trusting metadata supplied by a link.
-**Install from Git** also offers **Pin to commit** for agent-plugin installs
-(a full 40-character SHA, including private repositories); pinned agent plugins
-show a `pinned @ <sha8>` badge. Old `Settings → Plugins` links redirect here.
+Discovery sits underneath: the live [Plugin Catalog](./features/plugin-catalog.md)
+picker installs reviewed entries at their pinned commit into the selected
+profile, and **Install from Git** takes any other repository through the same
+review-then-install dialog; its optional **Pin to commit** field installs one
+exact 40-character commit SHA (private repos included), and pinned plugins
+carry a `pinned @ <sha8>` badge in the list. Old `Settings → Plugins` links
+redirect here.
## Troubleshooting
diff --git a/website/docs/user-guide/features/plugin-catalog.md b/website/docs/user-guide/features/plugin-catalog.md
index 04fc8a853b5..8005cf15673 100644
--- a/website/docs/user-guide/features/plugin-catalog.md
+++ b/website/docs/user-guide/features/plugin-catalog.md
@@ -17,7 +17,7 @@ hermes plugins install <name>
Browse it visually at **[/docs/plugins](/plugins)** — entries are shelved by
category (Memory, Desktop, Platforms, Web & Browser, Tools, Voice, Automation,
Models), with search, tier filters (Official / Community), capability chips, and
-**Open in Hermes Desktop** buttons and copyable CLI commands for every entry.
+copyable install commands for every entry.
Every entry also has its own page at `/docs/plugins/<name>` (click a card):
the full description and any disclosure, the pinned commit, tools, hooks and
@@ -27,12 +27,6 @@ author** shelf. Authors have a page at `/docs/plugins/by/<maintainer>` listing
everything they maintain in the catalog. Both are generated at build time from
the same catalog files, so a merged PR is the only way a page changes.
-In Desktop, open **Capabilities → Plugins → Browse** for the native catalog
-view. It is not an embedded website. **Installed** is a separate tab backed
-by the app's desktop-plugin registry and the selected profile's agent-plugin
-state, rather than catalog metadata. Skills uses the same **Installed / Browse**
-layout; search stays at the top and the tab switch and actions share one row.
-
The catalog complements — it does not replace — the existing
[plugin system](plugins.md). Anything you can install from the catalog is a
normal plugin under the hood; the catalog just adds discovery and a review
@@ -42,20 +36,6 @@ During desktop onboarding, the setup guide can also offer catalog plugins and sk
approval card. Each row installs into your `default` profile only when you click Install, at the
same reviewed commit this page describes.
-### Published browse data
-
-The website and Desktop read the same generated CDN snapshot:
-[`https://hermes-agent.nousresearch.com/docs/api/plugins.json`](https://hermes-agent.nousresearch.com/docs/api/plugins.json).
-Desktop fetches it through
-`https://nousresearch.github.io/hermes-agent/docs/api/plugins.json`; the public
-docs alias serves the same data. The docs build reads `plugin-catalog/*.yaml`
-and adds cached repository star counts. It also publishes the installer's
-removed-entry list. Neither Browse view crawls source repositories or queries
-the GitHub API live.
-
-This browse snapshot is distinct from the installer's
-[`plugin-catalog.json`](#live-refresh), which resolves catalog names and pins.
-
## What's in an entry
Each catalog entry is a small YAML file in the
@@ -148,22 +128,6 @@ repository. Review the code of anything you give credentials to.
## Installing from the catalog
-On the website, **Open in Hermes Desktop** opens a protocol link of this form:
-
-```text
-hermes://plugin/install?catalog=example-plugin
-```
-
-Desktop resolves the name against the published catalog and asks you to review
-the source, destination and components before confirming. The link does not
-auto-install or supply its own repository or commit. An unknown name or failed
-lookup shows an error; it never falls back to a repository install. For the
-agent-plugin component, the backend resolves the catalog name to its reviewed pin.
-
-Use an updated Desktop build for catalog links and the Skills Hub's
-`hermes://skill/install?identifier=...` route. The cards retain CLI commands,
-so you can install by catalog name without Desktop:
-
```bash
# Install a reviewed catalog entry by name (checks out the pinned SHA)
hermes plugins install <name>
diff --git a/website/docs/user-guide/features/plugins.md b/website/docs/user-guide/features/plugins.md
index 902b6f35b95..e8623a0c7c0 100644
--- a/website/docs/user-guide/features/plugins.md
+++ b/website/docs/user-guide/features/plugins.md
@@ -207,11 +207,10 @@ plugin; choose a new exact commit explicitly with
profile-local install metadata contains no config values, environment values,
secrets, or capability grants.
-The same agent-plugin pin is available in Hermes Desktop: **Capabilities →
-Plugins → Install from Git** has a *Pin to commit* field that takes the full
-40-character SHA, and **Installed** shows a `pinned @ <sha8>` badge on pinned
-agent plugins. This does not guarantee a pinned standalone desktop-plugin
-install. `hermes plugins list` prints
+The same pin is available in Hermes Desktop: **Skills → Plugins → Install from
+Git** has a *Pin to commit* field that takes the full 40-character SHA, and the
+plugins list shows a `pinned @ <sha8>` badge on every pinned install so a team
+can confirm everyone is running the same commit. `hermes plugins list` prints
the pin in its Source column (`git pinned@<sha8>`). Pins work for private
repositories too, through the same stored credentials described below.
@@ -457,25 +456,6 @@ Ordinary Hermes application updates preserve user plugin directories, including
wrapper files and external sidecar links. Explicit plugin updates or removals
can change those files. See [Package management](../../reference/package-management.md)
and the [plugin authoring guide](../../developer-guide/plugins/index.md#lazy-install-optional-python-dependencies).
-
-### Installed and Browse in Desktop
-
-Open **Capabilities → Plugins**. **Installed** reads the app's desktop-plugin
-registry and the selected profile's actual agent-plugin state, combining both
-halves in one row where appropriate. It is not a list of catalog entries
-assumed to be installed. **Browse** is a native catalog view, not an embedded
-website; it uses the same **Installed / Browse** tabs as Skills, with search
-at the top and the tab switch and actions on one row.
-
-Desktop and the public [Plugin Catalog](/plugins) consume the same CDN
-snapshot, [`/docs/api/plugins.json`](https://hermes-agent.nousresearch.com/docs/api/plugins.json).
-The public alias serves the same data as Desktop's fetch URL,
-`https://nousresearch.github.io/hermes-agent/docs/api/plugins.json`. The docs
-build generates it from `plugin-catalog/*.yaml` and cached star counts. The
-same publish also supplies the removed-entry list used by the installer.
-Browsing does not query GitHub live or fetch source repos;
-the installer retrieves code only as part of the separate install flow.
-
### One-click install links (Desktop)
Hermes Desktop registers the `hermes://` URL scheme, so a website, README, or
@@ -486,23 +466,19 @@ hermes://plugin/install?catalog=NAME # catalog entry, installs the
hermes://plugin/install?repo=owner/repo # any git repo
hermes://plugin/install?repo=owner/repo&enable=1 # enable the agent plugin after install
hermes://plugin/install?repo=owner/repo&force=1 # replace an existing install
+hermes://plugin/install?catalog=<name> # reviewed catalog entry at its pinned commit
```
The `catalog=<name>` form is what the **Open in Hermes Desktop** button on
every [Plugin Catalog](./plugin-catalog.md) card uses. Desktop resolves the
-name against the live catalog (the same feed **Capabilities → Plugins → Browse**
-shows) and opens the same **reviewed catalog entry** dialog an in-app
+name against the live catalog (the same feed the **Capabilities → Plugins**
+picker shows) and opens the same **reviewed catalog entry** dialog an in-app
pick does: the agent half installs at the catalog's pinned commit, never the
branch tip. The link carries no repo URL, and a name that is not in the
catalog shows an error toast and nothing else — it is never reinterpreted as a
git path, so a link cannot smuggle an unreviewed repo behind a
familiar-looking name.
-Use an updated Desktop build for catalog links and the Skills Hub's
-`hermes://skill/install?identifier=...` route. If the app is missing or too old,
-use the card's copyable `hermes plugins install <catalog-name>` command to
-retain catalog resolution.
-
For a `repo=` link, clicking one opens Hermes and shows a **confirmation dialog** — the repo id,
a "Before you install" note, and GitHub browse + clone links — then
shallow-clones the repo to detect what it ships (an **agent plugin** —
diff --git a/website/docs/user-guide/features/skills.md b/website/docs/user-guide/features/skills.md
index a8594f51897..b791c38492b 100644
--- a/website/docs/user-guide/features/skills.md
+++ b/website/docs/user-guide/features/skills.md
@@ -17,52 +17,6 @@ See also:
- [Bundled Skills Catalog](../../reference/skills-catalog.md)
- [Official Optional Skills Catalog](../../reference/optional-skills-catalog.md)
-## Browse and install in Desktop
-
-Open **Capabilities → Skills** and switch between **Installed** and **Browse**.
-Search stays at the top; the tab switch and actions share one row.
-**Installed** reads the selected profile's actual skills and enabled state;
-it is not inferred from the public catalog. **Browse** is a native catalog UI,
-not an embedded website or a second, smaller catalog.
-
-Desktop and the public [Skills Hub](/skills) read the same published CDN
-snapshot: [`/docs/api/skills.json`](https://hermes-agent.nousresearch.com/docs/api/skills.json).
-The public docs alias serves the same snapshot as Desktop's fetch URL,
-`https://nousresearch.github.io/hermes-agent/docs/api/skills.json`. The docs
-build generates it from bundled `skills/`, `optional-skills/`, and the
-centralized skills index. Browsing does not crawl GitHub or query upstream
-marketplaces live; installation still retrieves the selected skill through
-its source's installer.
-
-### Install from the website
-
-The Skills Hub has an **Install in Hermes** button on each installable card. It opens the
-installed Hermes Desktop app with a URL-encoded, source-qualified skill target:
-for example, `official/...` for optional skills or `clawhub/...` for ClawHub.
-Bundled skills use an explicit repository path rather than an ambiguous bare
-name. When an older snapshot lacks that explicit bundled target, the website
-omits its install link and native Browse disables installation rather than
-resolving an ambiguous name. The next docs publish supplies those targets.
-The same target is used by native Browse and the card's CLI fallback:
-
-```text
-hermes://skill/install?identifier=official%2Fsecurity%2F1password
-```
-
-Hermes shows **Install “skill-name”?** with separate **Source** and **Install to**
-rows. Cancel makes no changes. After confirmation, the same dialog shows
-**Installing…**, then **Installed** and a completion notification. Errors stay
-in the dialog so you can read them and retry. Installation uses the existing
-Skills Hub pipeline, including security scanning, action logs, and installed-list
-refresh. If you switch profile or connection while the confirmation is open,
-reopen the link for the new destination. Changes apply to
-new sessions; a link cannot bypass scanning or select a different profile.
-
-The public links use `hermes://`, not the development-only `hermes-dev://`
-scheme. The `skill/install` route requires an updated Desktop build. If the
-app is missing or the link is not recognized, update Desktop or expand the
-card to copy its CLI install command instead.
-
## Starting with a blank slate
By default every profile is seeded with the bundled skill catalog, and each `hermes update` adds any newly bundled skills. If you want a profile with **no bundled skills** — and that stays empty across updates — you have two paths:
diff --git a/website/scripts/extract-skills.py b/website/scripts/extract-skills.py
index b57276aefa0..1a0ef30e888 100644
--- a/website/scripts/extract-skills.py
+++ b/website/scripts/extract-skills.py
@@ -313,11 +313,6 @@ def extract_local_skills():
elif isinstance(cmds, str) and cmds.strip():
commands = [cmds.strip()]
- rel_id = rel.replace(os.sep, "/")
- install_identifier = (
- f"official/{rel_id}" if source_label == "optional"
- else f"NousResearch/hermes-agent/skills/{rel_id}"
- )
skills.append({
"name": fm.get("name", os.path.basename(root)),
"description": fm.get("description", ""),
@@ -333,8 +328,6 @@ def extract_local_skills():
"envVars": env_vars,
"commands": commands,
"docsPath": _docs_page_path(rel, source_label),
- "installIdentifier": install_identifier,
- "installCmd": f"hermes skills install {install_identifier}",
})
return skills
@@ -445,7 +438,6 @@ def extract_unified_index_skills():
"docsPath": "",
"identifier": identifier,
"installCmd": install_cmd,
- "installIdentifier": install_cmd.removeprefix("hermes skills install "),
"sourceUrl": source_url,
})
diff --git a/website/src/components/PluginCatalog/catalog.ts b/website/src/components/PluginCatalog/catalog.ts
index 24a656a8b58..8ee1d5b7482 100644
--- a/website/src/components/PluginCatalog/catalog.ts
+++ b/website/src/components/PluginCatalog/catalog.ts
@@ -2,9 +2,6 @@
// author pages (plugins/plugin-catalog-pages generates their routes). One definition of the entry
// shape, the tier/category taxonomy and the link builders keeps the three surfaces from drifting.
-import { pluginCatalogInstallUrl } from "../../../../apps/shared/src/catalog-install";
-import { PLUGIN_CATEGORIES } from "../../../../apps/shared/src/catalog-browse";
-
export interface PluginCapabilities {
providesTools?: string[];
providesHooks?: string[];
@@ -62,7 +59,7 @@ export const SUBMIT_PLUGIN_URL = "/developer-guide/plugins/catalog-submission";
/** Deep link into the Desktop app's Install Plugin dialog, catalog mode: the app
* resolves the reviewed pin itself, so the page never hands it a repo URL. */
export function desktopInstallLink(name: string): string {
- return pluginCatalogInstallUrl({ name });
+ return `hermes://plugin/install?catalog=${encodeURIComponent(name)}`;
}
/** Site route of an entry's page (Docusaurus prefixes baseUrl/locale via <Link>). */
@@ -106,8 +103,20 @@ export const TIER_CONFIG: Record<
},
};
-// Browse taxonomy, shared with Desktop. Its order is the order of the filter pills and grouped sections.
-export const CATEGORY_CONFIG = PLUGIN_CATEGORIES;
+// Browse taxonomy. Order here is the order of the filter pills and of the
+// grouped sections; keep it in sync with CATALOG_CATEGORIES in
+// hermes_cli/plugin_catalog.py and website/scripts/extract-plugins.py.
+export const CATEGORY_CONFIG: Record<string, { label: string; icon: string; blurb: string }> = {
+ desktop: { label: "Desktop", icon: "\u{1F5A5}\u{FE0F}", blurb: "Panes, tabs and views for Hermes Desktop" },
+ memory: { label: "Memory", icon: "\u{1F9E0}", blurb: "Memory providers and context engines" },
+ platform: { label: "Platforms", icon: "\u{1F4AC}", blurb: "Messaging and channel adapters" },
+ web: { label: "Web & Browser", icon: "\u{1F310}", blurb: "Search backends, extraction and browser control" },
+ tools: { label: "Tools", icon: "\u{1F6E0}\u{FE0F}", blurb: "New tools the agent can call" },
+ voice: { label: "Voice", icon: "\u{1F399}\u{FE0F}", blurb: "Speech, TTS and realtime audio" },
+ automation: { label: "Automation", icon: "\u{23F1}\u{FE0F}", blurb: "Hooks, wake triggers and session automation" },
+ models: { label: "Models", icon: "\u{2728}", blurb: "Model and inference providers" },
+ general: { label: "General", icon: "\u{1F4E6}", blurb: "Plugins that span several areas" },
+};
export const CATEGORY_ORDER = Object.keys(CATEGORY_CONFIG);
export function categoryOf(plugin: Pick<CatalogPlugin, "category">) {
diff --git a/website/src/pages/plugins/index.tsx b/website/src/pages/plugins/index.tsx
index 16715640fd8..6c482cfd32b 100644
--- a/website/src/pages/plugins/index.tsx
+++ b/website/src/pages/plugins/index.tsx
@@ -25,7 +25,6 @@ import {
tierOf,
} from "../../components/PluginCatalog/catalog";
import CopyButton from "../../components/PluginCatalog/CopyButton";
-import { groupCatalogPlugins, sortCatalogPlugins } from "../../../../apps/shared/src/catalog-browse";
// Routes Docusaurus serves the static API JSON from. `baseUrl` is `/docs/`,
// `static/api/` ends up at `/docs/api/` — same pattern as the Skills Hub.
@@ -46,8 +45,17 @@ const SORT_OPTIONS: { key: SortKey; label: string; title: string }[] = [
{ key: "updated", label: "Recently updated", title: "Most recently re-pinned or edited first" },
];
+function dateMs(iso?: string | null): number {
+ const t = iso ? new Date(iso).getTime() : NaN;
+ return Number.isFinite(t) ? t : -Infinity;
+}
+
function sortPlugins(list: CatalogPlugin[], sort: SortKey): CatalogPlugin[] {
- return sortCatalogPlugins(list, sort);
+ if (sort === "stars") return list;
+ const field = sort === "newest" ? "addedAt" : "updatedAt";
+ return [...list].sort(
+ (a, b) => dateMs(b[field]) - dateMs(a[field]) || a.name.localeCompare(b.name),
+ );
}
function highlightMatch(text: string, query: string): React.ReactNode {
@@ -486,7 +494,12 @@ export default function PluginCatalogPage() {
// than one undifferentiated wall. Filtering or searching flattens to a grid.
const grouped = useMemo(() => {
if (search.trim() || categoryFilter !== "all") return null;
- return groupCatalogPlugins(filtered);
+ const buckets = new Map<string, CatalogPlugin[]>();
+ for (const p of filtered) {
+ const key = CATEGORY_CONFIG[p.category] ? p.category : "general";
+ (buckets.get(key) ?? buckets.set(key, []).get(key)!).push(p);
+ }
+ return CATEGORY_ORDER.filter((c) => buckets.has(c)).map((c) => [c, buckets.get(c)!] as const);
}, [filtered, search, categoryFilter]);
const categoryCounts = useMemo(() => {
diff --git a/website/src/pages/skills/index.tsx b/website/src/pages/skills/index.tsx
index 37d39a60207..366c25937cb 100644
--- a/website/src/pages/skills/index.tsx
+++ b/website/src/pages/skills/index.tsx
@@ -2,7 +2,6 @@ import React, { useState, useMemo, useCallback, useRef, useEffect } from "react"
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import styles from "./styles.module.css";
-import { skillCatalogInstallIdentifier, skillCatalogInstallUrl } from "../../../../apps/shared/src/catalog-install";
interface Skill {
name: string;
@@ -20,7 +19,6 @@ interface Skill {
commands?: string[];
docsPath?: string;
identifier?: string;
- installIdentifier?: string;
installCmd?: string;
/** Clickable URL to the skill's origin (repo / detail page). Synthesized
* in extract-skills.py for community skills that have no generated docs
@@ -302,7 +300,6 @@ function SkillCard({
}) {
const src = SOURCE_CONFIG[skill.source] || SOURCE_CONFIG["optional"];
const icon = CATEGORY_ICONS[skill.category] || "\u{1F4E6}";
- const installUrl = skillCatalogInstallUrl(skill);
return (
<div
@@ -354,16 +351,6 @@ function SkillCard({
))}
</div>
- {!onPick && installUrl && (
- <a
- className={styles.pickBtn}
- href={installUrl}
- onClick={(e) => e.stopPropagation()}
- >
- Install in Hermes
- </a>
- )}
-
{expanded && (
<div className={styles.cardDetail}>
{skill.overview && (
@@ -432,9 +419,9 @@ function SkillCard({
</div>
)}
<div className={styles.installHint}>
- <code>{skill.installCmd || `hermes skills install ${skillCatalogInstallIdentifier(skill) || skill.name}`}</code>
+ <code>{skill.installCmd || `hermes skills install ${skill.name}`}</code>
<CopyButton
- text={skill.installCmd || `hermes skills install ${skillCatalogInstallIdentifier(skill) || skill.name}`}
+ text={skill.installCmd || `hermes skills install ${skill.name}`}
/>
</div>
{onPick ? (
@@ -539,8 +526,8 @@ export default function SkillsDashboard() {
{
type: "hermes-skill-pick",
name: skill.name,
- identifier: skillCatalogInstallIdentifier(skill) || skill.name,
- installCmd: skill.installCmd || `hermes skills install ${skillCatalogInstallIdentifier(skill) || skill.name}`,
+ identifier: skill.identifier || skill.name,
+ installCmd: skill.installCmd || `hermes skills install ${skill.name}`,
source: skill.source,
},
"*"
@@ -838,7 +825,12 @@ export default function SkillsDashboard() {
<strong className={styles.heroAccent}>
{data ? allSkillsLocal.length.toLocaleString() : "…"}
</strong>{" "}
- skills across {sources.length - 1} registries. Open in Hermes Desktop to review and install, or copy the CLI command.
+ skills across {sources.length - 1} registries
+ {loadError && (
+ <span style={{ color: "#f87171", marginLeft: 8 }}>
+ · failed to load catalog ({loadError})
+ </span>
+ )}
</p>
{(indexMetaLocal?.indexGeneratedAt || indexMetaLocal?.extractedAt) && (
<p className={styles.heroSub} style={{ fontSize: "0.85rem", opacity: 0.75 }}>
diff --git a/website/src/pages/skills/styles.module.css b/website/src/pages/skills/styles.module.css
index a1bba33efd9..137cc2c489c 100644
--- a/website/src/pages/skills/styles.module.css
+++ b/website/src/pages/skills/styles.module.css
@@ -1204,8 +1204,6 @@
color: var(--ifm-color-primary);
font-size: 0.85rem;
font-weight: 600;
- text-align: center;
- text-decoration: none;
cursor: pointer;
transition: background 0.15s ease, color 0.15s ease;
}
@@ -1214,10 +1212,4 @@
background: var(--ifm-color-primary);
/* --ifm-background-color is transparent in light mode (#91491). */
color: var(--ifm-color-emphasis-0, #f7f8fa);
- text-decoration: none;
-}
-
-.pickBtn:focus-visible {
- outline: 2px solid var(--ifm-color-primary);
- outline-offset: 2px;
}