The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(desktop): filter and badge plugins by tier (Official, Verified, Community)
Austin Pickettde44b64dd3fc
diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsxindex c1e12350d2b..962acf9db20 100644--- a/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx+++ b/apps/desktop/src/app/capabilities/catalog/catalog-browser.tsx@@ -360,7 +360,7 @@ export const CatalogBrowser = memo(function CatalogBrowser({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 filtered = sortCatalog(filterCatalog(visible, facets, deferredQuery, isInstalled, kind), sort, kind)const discover = isDiscoverView(facets, deferredQuery)const pageOrder = filtered@@ -457,6 +457,7 @@ export const CatalogBrowser = memo(function CatalogBrowser({actions={actions}categories={catalogCategories(visible)}facets={facets}+ kind={kind}onCategory={filters.toggleCategory}onClear={clearFilters}onInstalled={filters.toggleInstalled}@@ -464,7 +465,7 @@ export const CatalogBrowser = memo(function CatalogBrowser({onTag={filters.toggleTag}resultCount={filtered.length}sortControl={sortControl}- sources={catalogSources(visible)}+ sources={catalogSources(visible, kind)}tags={catalogTags(visible, facets.tags, TAG_LIMIT)}/>{notice}diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-curation.ts b/apps/desktop/src/app/capabilities/catalog/catalog-curation.tsindex ba33eab2455..4daba9f1e40 100644--- a/apps/desktop/src/app/capabilities/catalog/catalog-curation.ts+++ b/apps/desktop/src/app/capabilities/catalog/catalog-curation.ts@@ -51,9 +51,13 @@ export function curatedFeaturedRank(kind: 'skills' | 'plugins', row: CurationRowexport type PluginTier = 'official' | 'verified' | 'community'+/** Trust order: the tier filter, chips and shelves all read it. */+export const PLUGIN_TIER_ORDER: readonly PluginTier[] = ['official', 'verified', 'community']+/** Catalog tier straight from the feed (`tier` in plugin-catalog/*.yaml):* official and bundled are Nous, verified is granted by Nous to plugins from- * the company behind the integration, everything else is community. */+ * the company behind the integration, everything else is community —+ * including installed-only values (`user`, `git`, desktop kinds). */export function pluginTier(entry: { source: string }): PluginTier {if (entry.source === 'official' || entry.source === 'bundled') {return 'official'diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-filter-bar.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-filter-bar.tsxindex 15259e47699..22646cb1b46 100644--- a/apps/desktop/src/app/capabilities/catalog/catalog-filter-bar.tsx+++ b/apps/desktop/src/app/capabilities/catalog/catalog-filter-bar.tsx@@ -1,4 +1,4 @@-import { IconCategory, IconDatabase, IconFilter2 } from '@tabler/icons-react'+import { IconCategory, IconDatabase, IconFilter2, IconRosetteDiscountCheck } from '@tabler/icons-react'import { type ReactNode, useId, useState } from 'react'import { Button } from '@/components/ui/button'@@ -6,11 +6,12 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popoverimport { SegmentedControl } from '@/components/ui/segmented-control'import { useI18n } from '@/i18n'-import { catalogLabel } from './catalog-data'+import { type CatalogKind, catalogLabel } from './catalog-data'import type { FacetRow } from './catalog-filters'import type { CatalogFacets } from './catalog-query'interface CatalogFilterBarProps {+ kind: CatalogKindsources: string[]categories: ReadonlyArray<readonly [string, { label: string; count: number }]>tags: FacetRow[]@@ -34,12 +35,15 @@ export function CatalogFilterBar(props: CatalogFilterBarProps) {const c = t.catalogconst panelId = useId()const [mode, setMode] = useState<'categories' | 'sources'>('categories')+ // Plugins file the source facet by trust tier; skills by registry.+ const tiers = props.kind === 'plugins'+ const tierLabel = (value: string) => (tiers ? c.tierLabels[value as keyof typeof c.tierLabels] : undefined)const [expanded, setExpanded] = useState(false)const [more, setMore] = useState(false)const rows = mode === 'categories'? props.categories.map(([value, meta]) => ({ value, label: catalogLabel(meta.label) }))- : props.sources.map(value => ({ value, label: catalogLabel(value) }))+ : props.sources.map(value => ({ value, label: tierLabel(value) ?? catalogLabel(value) }))const selected = props.facets[mode]const onSelect = mode === 'categories' ? props.onCategory : props.onSource@@ -50,7 +54,7 @@ export function CatalogFilterBar(props: CatalogFilterBarProps) {return (<div className="catalog-filter-bar" data-catalog-filters><div className="catalog-filter-row">- <SegmentedControl onChange={setMode} options={[{ id: 'categories', label: c.category, icon: IconCategory }, { id: 'sources', label: c.source, icon: IconDatabase }]} sizing="content" value={mode} />+ <SegmentedControl onChange={setMode} options={[{ id: 'categories', label: c.category, icon: IconCategory }, { id: 'sources', label: tiers ? c.tier : c.source, icon: tiers ? IconRosetteDiscountCheck : IconDatabase }]} sizing="content" value={mode} /><div className="catalog-filter-chips"><Button aria-pressed={!selected.length} onClick={() => onSelect(null)} size="xs" variant={!selected.length ? 'default' : 'outline'}>{t.skills.all}</Button><span aria-hidden className="px-1 text-(--ui-text-quaternary)">/</span>diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-metadata.tsx b/apps/desktop/src/app/capabilities/catalog/catalog-metadata.tsxindex 75ad6bbd2ab..78db997de6b 100644--- a/apps/desktop/src/app/capabilities/catalog/catalog-metadata.tsx+++ b/apps/desktop/src/app/capabilities/catalog/catalog-metadata.tsx@@ -6,10 +6,14 @@ import { Button } from '@/components/ui/button'import { Codicon } from '@/components/ui/codicon'import { Tip } from '@/components/ui/tooltip'import { useI18n } from '@/i18n'+import { CheckCircle2 } from '@/lib/icons'import { fmtDateTime, relativeTime } from '@/lib/time'import { type CatalogEntry, catalogLabel } from './catalog-data'+/** Trust tiers read at a glance (same tones as the installed-plugin pill); the rest stay muted. */+const SOURCE_TONE: Record<string, 'default' | 'success'> = { official: 'default', verified: 'success' }+interface CatalogMetadataProps {entry: CatalogEntryonCategory?: (category: string) => void@@ -35,7 +39,8 @@ export function CatalogHeaderMeta({ entry }: { entry: CatalogEntry }) {return (<span className="flex min-w-0 items-center justify-start gap-1">{entry.source && (- <Badge className="max-w-full" size="xs" variant="muted">+ <Badge className="max-w-full" size="xs" variant={SOURCE_TONE[entry.source] ?? 'muted'}>+ {entry.source === 'verified' && <CheckCircle2 aria-hidden className="size-3 shrink-0" />}<span className="truncate">{catalogLabel(entry.source)}</span></Badge>)}diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-query.test.ts b/apps/desktop/src/app/capabilities/catalog/catalog-query.test.tsnew file mode 100644index 00000000000..c7c287176c7--- /dev/null+++ b/apps/desktop/src/app/capabilities/catalog/catalog-query.test.ts@@ -0,0 +1,32 @@+import { describe, expect, it } from 'vitest'++import type { CatalogEntry } from './catalog-data'+import { type CatalogFacets, catalogSources, filterCatalog } from './catalog-query'++const entry = (name: string, source: string) => ({ id: name, name, source, category: 'tools', tags: [], search: name }) as unknown as CatalogEntry++const facets = (sources: string[]): CatalogFacets => ({ sources, categories: [], tags: [], installedOnly: false })++const plugins = [entry('a', 'community'), entry('b', 'user'), entry('c', 'verified'), entry('d', 'bundled'), entry('e', 'official')]++describe('plugin tier facet', () => {+ it('lists the tiers present in trust order and folds installed-only values in', () => {+ expect(catalogSources(plugins, 'plugins')).toEqual(['official', 'verified', 'community'])+ expect(catalogSources([entry('x', 'git'), entry('y', 'verified')], 'plugins')).toEqual(['verified', 'community'])+ })++ it('filters by the normalized tier', () => {+ const names = (sources: string[]) => filterCatalog(plugins, facets(sources), '', () => false, 'plugins').map(row => row.name)++ expect(names(['official'])).toEqual(['d', 'e'])+ expect(names(['community'])).toEqual(['a', 'b'])+ expect(names(['verified', 'official'])).toEqual(['c', 'd', 'e'])+ })++ it('keeps skills on their raw registry source', () => {+ const skills = [entry('s1', 'clawhub'), entry('s2', 'official'), entry('s3', 'clawhub')]++ expect(catalogSources(skills, 'skills')).toEqual(['clawhub', 'official'])+ expect(filterCatalog(skills, facets(['clawhub']), '', () => false, 'skills').map(row => row.name)).toEqual(['s1', 's3'])+ })+})diff --git a/apps/desktop/src/app/capabilities/catalog/catalog-query.ts b/apps/desktop/src/app/capabilities/catalog/catalog-query.tsindex 4d446fea664..1e56a67ffad 100644--- a/apps/desktop/src/app/capabilities/catalog/catalog-query.ts+++ b/apps/desktop/src/app/capabilities/catalog/catalog-query.ts@@ -1,5 +1,6 @@import { sortCatalogPlugins } from '@hermes/shared'+import { PLUGIN_TIER_ORDER, pluginTier } from './catalog-curation'import type { CatalogEntry, CatalogKind } from './catalog-data'import type { FacetRow } from './catalog-filters'@@ -14,7 +15,15 @@ export interface CatalogFacets {export const EMPTY_FACETS: CatalogFacets = { sources: [], categories: [], tags: [], installedOnly: false }-export const catalogSources = (entries: CatalogEntry[]) => [...new Set(entries.map(entry => entry.source))]+/** Facet value an entry files under: the normalized tier for plugins, the registry for skills. */+export const facetSource = (entry: CatalogEntry, kind: CatalogKind) => (kind === 'plugins' ? pluginTier(entry) : entry.source)++/** Source facet rows; for plugins, the tiers present, in trust order. */+export function catalogSources(entries: CatalogEntry[], kind: CatalogKind) {+ const present = new Set(entries.map(entry => facetSource(entry, kind)))++ return kind === 'plugins' ? PLUGIN_TIER_ORDER.filter(tier => present.has(tier)) : [...present]+}/** Category facet rows with counts, A–Z with "Other" last. */export function catalogCategories(entries: CatalogEntry[]) {@@ -50,13 +59,14 @@ export function filterCatalog(entries: CatalogEntry[],facets: CatalogFacets,query: string,- isInstalled: (entry: CatalogEntry) => boolean+ isInstalled: (entry: CatalogEntry) => boolean,+ kind: CatalogKind) {const { sources, categories, tags, installedOnly } = facetsreturn entries.filter(entry =>- (!sources.length || sources.includes(entry.source)) &&+ (!sources.length || sources.includes(facetSource(entry, kind))) &&(!categories.length || categories.includes(entry.category)) &&(!tags.length || tags.some(tag => entry.tags.includes(tag))) &&(!installedOnly || isInstalled(entry)) &&diff --git a/apps/desktop/src/i18n/en_catalog.ts b/apps/desktop/src/i18n/en_catalog.tsindex ab47508538c..ff2aca702da 100644--- a/apps/desktop/src/i18n/en_catalog.ts+++ b/apps/desktop/src/i18n/en_catalog.ts@@ -58,6 +58,8 @@ export const enCatalog: CatalogTranslations = {installHint: 'Review the source before installing. Changes apply to new sessions.',results: (count: number) => `${count.toLocaleString()} result${count === 1 ? '' : 's'}`,back: 'Back to results',+ tier: 'Tier',+ tierLabels: { official: 'Official', verified: 'Verified', community: 'Community' },tiers: {official: { title: 'Official Plugins', blurb: 'Built and maintained by Nous Research.' },verified: { title: 'Verified Plugins', blurb: 'From the company behind the integration, verified by Nous.' }diff --git a/apps/desktop/src/i18n/overlay-gaps.json b/apps/desktop/src/i18n/overlay-gaps.jsonindex c1cd6903943..1be4fffea0c 100644--- a/apps/desktop/src/i18n/overlay-gaps.json+++ b/apps/desktop/src/i18n/overlay-gaps.json@@ -274,6 +274,10 @@"catalog.source": ["de","es","fr"],"catalog.tags": ["de","es","fr"],"catalog.thisComputer": ["de","es","fr"],+ "catalog.tier": ["ar","de","es","fr","ja","ru","zh","zh-hant"],+ "catalog.tierLabels.community": ["ar","de","es","fr","ja","ru","zh","zh-hant"],+ "catalog.tierLabels.official": ["ar","de","es","fr","ja","ru","zh","zh-hant"],+ "catalog.tierLabels.verified": ["ar","de","es","fr","ja","ru","zh","zh-hant"],"catalog.tiers.official.blurb": ["ar","de","es","fr","ja","ru","zh","zh-hant"],"catalog.tiers.official.title": ["ar","de","es","fr","ja","ru","zh","zh-hant"],"catalog.tiers.verified.blurb": ["ar","de","es","fr","ja","ru","zh","zh-hant"],diff --git a/apps/desktop/src/i18n/types_catalog.ts b/apps/desktop/src/i18n/types_catalog.tsindex 65f50c5264d..6ea28e9543e 100644--- a/apps/desktop/src/i18n/types_catalog.ts+++ b/apps/desktop/src/i18n/types_catalog.ts@@ -56,6 +56,8 @@ export interface CatalogTranslations {installHint: stringresults: (count: number) => stringback: string+ tier: string+ tierLabels: Record<'official' | 'verified' | 'community', string>tiers: {official: { title: string; blurb: string }verified: { title: string; blurb: string }diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.jsonindex 3d243061203..4bf7dead435 100644--- a/locales/_keys.desktop.json+++ b/locales/_keys.desktop.json@@ -623,6 +623,10 @@"catalog.source","catalog.tags","catalog.thisComputer",+ "catalog.tier",+ "catalog.tierLabels.community",+ "catalog.tierLabels.official",+ "catalog.tierLabels.verified","catalog.tiers.official.blurb","catalog.tiers.official.title","catalog.tiers.verified.blurb",