Skip to content

The agent that grows with you

refactor(desktop): the Capabilities page is a module at /capabilities, one folder per tab (#115054)

Siddharth Balyan633dda6d7fdc
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index d6ff99058cb..20d7cc8951c 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -7025,7 +7025,7 @@ async function showPluginCompatNoticeOnce() {
})
if (response === 0) {
- handleDeepLink(`${HERMES_PROTOCOL}://open/skills?tab=plugins`)
+ handleDeepLink(`${HERMES_PROTOCOL}://open/capabilities?tab=plugins`)
}
} finally {
try {
diff --git a/apps/desktop/src/api/client.ts b/apps/desktop/src/api/client.ts
index e82d3274fca..3b7e4ed9c9a 100644
--- a/apps/desktop/src/api/client.ts
+++ b/apps/desktop/src/api/client.ts
@@ -139,7 +139,7 @@ export function hermesApi<T>(request: HermesApiRequest): Promise<T> {
//
// A profile is not a machine-global name — it belongs to ONE gateway. The
// Capabilities surface can be pointed at any (connection, profile) pair
-// (SkillsView's scope selector, Bot Mode's fixedProfile/fixedConnection), so
+// (CapabilitiesView's scope selector, Bot Mode's fixedProfile/fixedConnection), so
// its REST helpers accept either the legacy string form or an explicit scope
// object:
//
diff --git a/apps/desktop/src/app/skills/index.test.tsx b/apps/desktop/src/app/capabilities/index.test.tsx
similarity index 93%
rename from apps/desktop/src/app/skills/index.test.tsx
rename to apps/desktop/src/app/capabilities/index.test.tsx
index daaa3224a01..e397d1e849f 100644
--- a/apps/desktop/src/app/skills/index.test.tsx
+++ b/apps/desktop/src/app/capabilities/index.test.tsx
@@ -20,7 +20,7 @@ const getProfiles = vi.fn()
const getSkillContent = vi.fn()
const getOfficialSkills = vi.fn()
-// Partial mock: keep the real module (SkillsView pulls in @/store/profile,
+// Partial mock: keep the real module (CapabilitiesView pulls in @/store/profile,
// whose import-time subscription calls setApiRequestProfile) and stub only the
// calls we assert on. Args are forwarded so the per-profile scope arg is
// observable.
@@ -46,7 +46,7 @@ vi.mock('@/store/notifications', () => ({
}))
// The catalog Install button routes through the hub action pipeline — stub the
-// action entrypoint (real module kept: SkillsView reads $hubActions and the
+// action entrypoint (real module kept: CapabilitiesView reads $hubActions and the
// query keys from it).
vi.mock('@/store/hub-actions', async importOriginal => ({
...(await importOriginal<typeof HubActions>()),
@@ -65,7 +65,7 @@ vi.mock('react-router', async importOriginal => ({
// Import at module scope (after the hoisted vi.mock calls) so the heavy
// component-tree transform is paid during collection, not billed against the
// first test's testTimeout — same flake class as messaging/index.test.tsx.
-const { SkillsView } = await import('./index')
+const { CapabilitiesView } = await import('./index')
function toolset(overrides: Record<string, unknown> = {}) {
return {
@@ -84,10 +84,10 @@ async function renderSkills() {
let result: ReturnType<typeof render>
await act(async () => {
result = render(
- // SkillsView reads skills/toolsets via useQuery, so it needs a provider.
+ // CapabilitiesView reads skills/toolsets via useQuery, so it needs a provider.
<QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/skills?tab=toolsets']}>
- <SkillsView />
+ <MemoryRouter initialEntries={['/capabilities?tab=toolsets']}>
+ <CapabilitiesView />
</MemoryRouter>
</QueryClientProvider>
)
@@ -120,12 +120,12 @@ afterEach(() => {
queryClient.clear()
})
-// SkillsView is a heavy module (import cost now paid at module scope above,
+// CapabilitiesView is a heavy module (import cost now paid at module scope above,
// during collection) but the file still legitimately runs ~14s on CI runners —
// right against the global 15s per-test budget, so slow runners cascade-fail
// all 11 tests (2× in a row on PR #93612, plus a main run the same hour).
// Give this file headroom; the tests are not slow individually.
-describe('SkillsView toolset management', { timeout: 60_000 }, () => {
+describe('CapabilitiesView toolset management', { timeout: 60_000 }, () => {
it('renders a switch for each toolset and toggles it off', async () => {
await renderSkills()
@@ -180,8 +180,8 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
await act(async () => {
render(
<QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/skills?tab=toolsets']}>
- <SkillsView />
+ <MemoryRouter initialEntries={['/capabilities?tab=toolsets']}>
+ <CapabilitiesView />
</MemoryRouter>
</QueryClientProvider>
)
@@ -225,8 +225,8 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
await act(async () => {
render(
<QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/skills?tab=skills']}>
- <SkillsView />
+ <MemoryRouter initialEntries={['/capabilities?tab=skills']}>
+ <CapabilitiesView />
</MemoryRouter>
</QueryClientProvider>
)
@@ -268,8 +268,8 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
await act(async () => {
render(
<QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/skills?tab=skills']}>
- <SkillsView />
+ <MemoryRouter initialEntries={['/capabilities?tab=skills']}>
+ <CapabilitiesView />
</MemoryRouter>
</QueryClientProvider>
)
@@ -286,7 +286,7 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
it('hub picker refuses to reinstall an already-installed skill', async () => {
const { notify } = await import('@/store/notifications')
- const { EmbeddedHubPicker } = await import('./embedded-hub-picker')
+ const { EmbeddedHubPicker } = await import('./skills/embedded-hub-picker')
render(<EmbeddedHubPicker installedNames={new Set(['web-research'])} profile={null} />)
@@ -323,8 +323,8 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
await act(async () => {
render(
<QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/skills']}>
- <SkillsView embedded />
+ <MemoryRouter initialEntries={['/capabilities']}>
+ <CapabilitiesView embedded />
</MemoryRouter>
</QueryClientProvider>
)
@@ -381,8 +381,8 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
await act(async () => {
render(
<QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/skills']}>
- <SkillsView embedded fixedConnection="homelab" fixedProfile="inbox-bot" />
+ <MemoryRouter initialEntries={['/capabilities']}>
+ <CapabilitiesView embedded fixedConnection="homelab" fixedProfile="inbox-bot" />
</MemoryRouter>
</QueryClientProvider>
)
@@ -494,8 +494,8 @@ describe('SkillsView toolset management', { timeout: 60_000 }, () => {
await act(async () => {
render(
<QueryClientProvider client={queryClient}>
- <MemoryRouter initialEntries={['/skills?tab=skills']}>
- <SkillsView />
+ <MemoryRouter initialEntries={['/capabilities?tab=skills']}>
+ <CapabilitiesView />
</MemoryRouter>
</QueryClientProvider>
)
diff --git a/apps/desktop/src/app/capabilities/index.tsx b/apps/desktop/src/app/capabilities/index.tsx
new file mode 100644
index 00000000000..71105f4b810
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/index.tsx
@@ -0,0 +1,217 @@
+import type * as React from 'react'
+import { useCallback, useMemo, useState } from 'react'
+
+import { PageLoader } from '@/components/page-loader'
+import { Button } from '@/components/ui/button'
+import { useI18n } from '@/i18n'
+import { queryClient } from '@/lib/query-client'
+import { invalidateSlashCompletions } from '@/lib/slash-completion-cache'
+import { useStoreSelector } from '@/lib/use-session-slice'
+import { $gateway } from '@/store/gateway'
+import { OFFICIAL_SKILLS_KEY } from '@/store/hub-actions'
+
+import { useRefreshHotkey } from '../hooks/use-refresh-hotkey'
+import { useRouteEnumParam } from '../hooks/use-route-enum-param'
+import { PanelEmpty } from '../overlays/panel'
+import { PageSearchShell } from '../page-search-shell'
+import type { SetStatusbarItemGroup } from '../shell/statusbar-controls'
+
+import { McpTab } from './mcp/mcp-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'
+import { TOOLSETS_QUERY_KEY, toolsetSearchTerms, useToolsetsQuery, visibleToolsetCount } from './toolsets/toolsets-data'
+import { ToolsetsTab } from './toolsets/toolsets-tab'
+
+// Skills Hub browsing lives inside the Skills tab. Legacy `?tab=hub`
+// links fall back to 'skills' via useRouteEnumParam.
+const CAPABILITY_MODES = ['skills', 'toolsets', 'mcp', 'plugins'] as const
+
+type CapabilityMode = (typeof CAPABILITY_MODES)[number]
+
+interface CapabilitiesViewProps extends React.ComponentProps<'section'> {
+ setStatusbarItemGroup?: SetStatusbarItemGroup
+ /** Embedded mode (plugin dialogs — e.g. Bot Mode's Advanced section): tab
+ * state lives in local React state instead of the route's `?tab=` param,
+ * so an embedding dialog never fights the page router. */
+ embedded?: boolean
+ /** Pin the WHOLE view to one profile: the scope selector is hidden and
+ * every tab reads/writes THAT profile. This is the plugin door — Bot Mode
+ * renders the real Capabilities surface pinned to a bot. */
+ fixedProfile?: string
+ /** Pin the view to a REGISTERED gateway connection alongside `fixedProfile`:
+ * every read/write routes to that machine's backend instead of the active
+ * gateway. `''`/`'local'` mean the local pool. This is Bot Mode's
+ * remote-target door — a bot living on another registered gateway gets the
+ * live surface pointed at ITS backend. Ignored without `fixedProfile`. */
+ fixedConnection?: string
+}
+
+/** The Capabilities page SHELL: tab selection, the search header, the profile /
+ * connection scope, the refresh hotkey, and the dispatch to one tab component
+ * per tab. Each tab owns its list, detail pane and writes; the two installed
+ * lists are fetched here because the tab pills count them for the tab the user
+ * is NOT on. */
+export function CapabilitiesView({
+ embedded = false,
+ fixedConnection,
+ fixedProfile,
+ setStatusbarItemGroup: _setStatusbarItemGroup,
+ ...props
+}: CapabilitiesViewProps) {
+ const { t } = useI18n()
+ // Both hooks run unconditionally (rules of hooks); embedded picks the local
+ // one so tab clicks inside a dialog don't rewrite the page URL.
+ const routeTab = useRouteEnumParam('tab', CAPABILITY_MODES, 'skills')
+ const localTab = useState<CapabilityMode>('skills')
+ const [mode, setMode] = embedded ? localTab : routeTab
+ // $gateway only feeds the MCP tab — gate the subscription so Skills/Toolsets
+ // tabs don't re-render on connect/disconnect/reconnect.
+ const gateway = useStoreSelector($gateway, g => (mode === 'mcp' ? g : null))
+
+ 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([
+ queryClient.invalidateQueries({ queryKey: SKILLS_QUERY_KEY }),
+ queryClient.invalidateQueries({ queryKey: TOOLSETS_QUERY_KEY }),
+ queryClient.invalidateQueries({ queryKey: OFFICIAL_SKILLS_KEY })
+ ])
+
+ invalidateSlashCompletions()
+
+ void refreshToolCalls(scope.profile)
+ }, [scope.profile])
+
+ useRefreshHotkey(refreshCapabilities)
+
+ // Rotating placeholder nudges from the user's own data — teach that search
+ // understands categories and tool names, not just titles.
+ const searchHints = useMemo(() => {
+ if (mode === 'skills' && skills?.length) {
+ return skillSearchTerms(skills).map(term => t.common.tryHint(term))
+ }
+
+ if (mode === 'toolsets' && toolsets?.length) {
+ return toolsetSearchTerms(toolsets).map(term => t.common.tryHint(term))
+ }
+
+ return undefined
+ }, [mode, skills, t, toolsets])
+
+ // MCP and Plugins load independently of the installed Skills/Tools lists.
+ const gated = mode === 'toolsets' || mode === 'skills'
+ const pending = gated && !(skills && toolsets)
+
+ const loadGate = !pending ? null : skillsFailed || toolsetsFailed ? (
+ <PanelEmpty
+ action={
+ <Button onClick={() => void refreshCapabilities()} size="sm">
+ {t.skills.refresh}
+ </Button>
+ }
+ description={skillsError instanceof Error ? skillsError.message : undefined}
+ icon="error"
+ title={t.skills.skillsLoadFailed}
+ />
+ ) : (
+ <PageLoader label={t.skills.loading} />
+ )
+
+ // One entry per tab. Each is keyed on the scope so switching profile or
+ // connection is a fresh tab — never one profile's selection, open editor or
+ // pending install left standing over another profile's backend.
+ const tabContent = {
+ // The gateway instance backs ONLY the live `reload.mcp` RPC, and it is the
+ // ACTIVE gateway's socket — for a scope pinned to a different backend that
+ // RPC would hot-reload the wrong machine's MCP servers, so it is withheld
+ // (config edits still apply on that backend's next session).
+ mcp: () => (
+ <McpTab gateway={scope.crossBackend ? null : gateway} key={`mcp-${scope.key}`} profile={scope.profile} />
+ ),
+ // 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}`}
+ profile={scope.profile}
+ scopeLabel={scope.label}
+ scopeSelector={scope.options.length > 1 ? <CapabilityScopeSelector compact scope={scope} /> : undefined}
+ />
+ ),
+ skills: () => (
+ <SkillsTab
+ key={`skills-${scope.key}`}
+ onRefresh={() => void refreshCapabilities()}
+ profile={scope.profile}
+ query={query}
+ skills={skills ?? []}
+ />
+ ),
+ toolsets: () => (
+ <ToolsetsTab key={`toolsets-${scope.key}`} profile={scope.profile} query={query} toolsets={toolsets ?? []} />
+ )
+ } satisfies Record<CapabilityMode, () => React.ReactNode>
+
+ return (
+ <PageSearchShell
+ {...props}
+ activeTab={mode}
+ onSearchChange={setQuery}
+ onTabChange={id => setMode(id as CapabilityMode)}
+ // MCP manages a handful of entries with the editor right there —
+ // searching it is noise.
+ searchHidden={mode === 'mcp' || mode === 'plugins'}
+ searchHints={searchHints}
+ searchPlaceholder={mode === 'skills' ? t.skills.searchSkills : t.skills.searchToolsets}
+ searchValue={query}
+ tabs={[
+ { id: 'skills', label: t.skills.tabSkills, meta: skills?.length ?? null },
+ { id: 'toolsets', label: t.skills.tabToolsets, meta: toolsets ? visibleToolsetCount(toolsets) : null },
+ { id: 'mcp', label: t.skills.tabMcp },
+ { id: 'plugins', label: t.skills.tabPlugins }
+ ]}
+ >
+ {/* One shared column: the scope selector sits above whichever tab is
+ active, so Skills / Tools / MCP all read and write the SAME selected
+ profile. */}
+ <div className="flex h-full flex-col">
+ {mode !== 'plugins' && <CapabilityScopeSelector scope={scope} />}
+ <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>
+ )
+}
+
+// Feature-detection flag for plugins (Bot Mode): TRUE means this build's
+// CapabilitiesView routes `fixedConnection` to the pinned connection's backend.
+// Older builds export CapabilitiesView WITHOUT the prop — passing it there would
+// silently read/write the ACTIVE gateway under the remote bot's profile name,
+// which is exactly the wrong-machine bug the prop exists to prevent. A static
+// property is probe-able without rendering.
+CapabilitiesView.supportsFixedConnection = true as const
diff --git a/apps/desktop/src/app/skills/mcp-tab.tsx b/apps/desktop/src/app/capabilities/mcp/mcp-tab.tsx
similarity index 99%
rename from apps/desktop/src/app/skills/mcp-tab.tsx
rename to apps/desktop/src/app/capabilities/mcp/mcp-tab.tsx
index 959405f0ee0..719533452a9 100644
--- a/apps/desktop/src/app/skills/mcp-tab.tsx
+++ b/apps/desktop/src/app/capabilities/mcp/mcp-tab.tsx
@@ -45,13 +45,13 @@ import { notify, notifyError } from '@/store/notifications'
import { $activeGatewayProfile, normalizeProfileKey } from '@/store/profile'
import { $activeSessionId } from '@/store/session'
-import { hermesConfigCacheWriter, useHermesConfigRecord } from '../hooks/use-config-record'
-import { useOnProfileSwitch } from '../hooks/use-on-profile-switch'
-import { useProfileSwitchLatch } from '../hooks/use-profile-switch-latch'
-import { DetailPane, ICON_BUTTON, MASTER_DETAIL_WIDE_COLS } from '../master-detail'
-import { PanelAddButton, PanelEmpty } from '../overlays/panel'
-import { prettyName } from '../settings/helpers'
-import { useDeepLinkHighlight } from '../settings/use-deep-link-highlight'
+import { hermesConfigCacheWriter, useHermesConfigRecord } from '../../hooks/use-config-record'
+import { useOnProfileSwitch } from '../../hooks/use-on-profile-switch'
+import { useProfileSwitchLatch } from '../../hooks/use-profile-switch-latch'
+import { DetailPane, ICON_BUTTON, MASTER_DETAIL_WIDE_COLS } from '../../master-detail'
+import { PanelAddButton, PanelEmpty } from '../../overlays/panel'
+import { prettyName } from '../../settings/helpers'
+import { useDeepLinkHighlight } from '../../settings/use-deep-link-highlight'
// The editor always speaks the ecosystem's mcp.json document format — names
// are the JSON keys, transport is inferred from `command` vs `url` — so any
diff --git a/apps/desktop/src/app/skills/plugin-packages.test.ts b/apps/desktop/src/app/capabilities/plugins/plugin-packages.test.ts
similarity index 100%
rename from apps/desktop/src/app/skills/plugin-packages.test.ts
rename to apps/desktop/src/app/capabilities/plugins/plugin-packages.test.ts
diff --git a/apps/desktop/src/app/skills/plugin-packages.ts b/apps/desktop/src/app/capabilities/plugins/plugin-packages.ts
similarity index 100%
rename from apps/desktop/src/app/skills/plugin-packages.ts
rename to apps/desktop/src/app/capabilities/plugins/plugin-packages.ts
diff --git a/apps/desktop/src/app/skills/plugins-tab.test.tsx b/apps/desktop/src/app/capabilities/plugins/plugins-tab.test.tsx
similarity index 100%
rename from apps/desktop/src/app/skills/plugins-tab.test.tsx
rename to apps/desktop/src/app/capabilities/plugins/plugins-tab.test.tsx
diff --git a/apps/desktop/src/app/skills/plugins-tab.tsx b/apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx
similarity index 98%
rename from apps/desktop/src/app/skills/plugins-tab.tsx
rename to apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx
index 9c8c1e5e5c9..8f96f3d26f3 100644
--- a/apps/desktop/src/app/skills/plugins-tab.tsx
+++ b/apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx
@@ -38,9 +38,9 @@ import { $paneHeightOverride, setPaneHeightOverride } from '@/store/panes'
import { openPluginInstallRequest } from '@/store/plugin-install-request'
import { $connection } from '@/store/session'
-import { PanelEmpty } from '../overlays/panel'
-import { Pill } from '../settings/primitives'
-import { useDeepLinkHighlight } from '../settings/use-deep-link-highlight'
+import { PanelEmpty } from '../../overlays/panel'
+import { Pill } from '../../settings/primitives'
+import { useDeepLinkHighlight } from '../../settings/use-deep-link-highlight'
import { mergePluginPackages, type PackageKind, type PluginPackage } from './plugin-packages'
@@ -75,7 +75,7 @@ interface PluginPickMessage {
type?: string
}
-/** Deep-link anchor for a package row (`/skills?tab=plugins&plugin=<key>`).
+/** 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}`
diff --git a/apps/desktop/src/app/capabilities/primitives.tsx b/apps/desktop/src/app/capabilities/primitives.tsx
new file mode 100644
index 00000000000..d6c5b2ad8f2
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/primitives.tsx
@@ -0,0 +1,60 @@
+import type { ReactNode } from 'react'
+
+import { useI18n } from '@/i18n'
+
+import { ListStripButton } from '../master-detail'
+import { PanelEmpty } from '../overlays/panel'
+
+// The chrome the Skills and Tools tabs share: one inspector header, one empty
+// state and one sort control, so switching between them never jumps.
+
+// Shared inspector header — mirrors Messaging's PlatformDetail so Skills and
+// Tools share one title/description block and tab switches don't jump.
+export function DetailHeader({
+ description,
+ pills,
+ title
+}: {
+ description: ReactNode
+ pills?: ReactNode
+ title: string
+}) {
+ return (
+ <header>
+ <div className="flex min-h-6 flex-wrap items-center gap-2">
+ <h3 className="min-w-0 truncate text-[0.9375rem] font-semibold tracking-tight">{title}</h3>
+ {pills}
+ </div>
+ <p className="mt-1 text-[length:var(--conversation-caption-font-size)] leading-(--conversation-caption-line-height) text-(--ui-text-tertiary)">
+ {description}
+ </p>
+ </header>
+ )
+}
+
+// Full-bleed empty state, matching the MCP tab (spans both columns, not a
+// cramped note in the left rail). Query-aware, and says "tools" not the
+// internal "toolsets".
+export function CapabilityEmpty({ noun, query }: { noun: string; query: string }) {
+ const { t } = useI18n()
+ const q = query.trim()
+
+ return (
+ <div className="flex h-full min-h-0 flex-1">
+ <PanelEmpty
+ description={q ? t.skills.emptyNothingMatches(q) : t.skills.emptyNoneAvailable(noun)}
+ icon="search"
+ title={t.skills.emptyNoneFound(noun)}
+ />
+ </div>
+ )
+}
+
+/** Most-used / least-used flip for a list strip. */
+export function SortButton({ desc, onFlip }: { desc: boolean; onFlip: () => void }) {
+ const { t } = useI18n()
+
+ return (
+ <ListStripButton onClick={onFlip}>{desc ? t.skills.sortMostUsedDesc : t.skills.sortLeastUsedAsc}</ListStripButton>
+ )
+}
diff --git a/apps/desktop/src/app/capabilities/scope-selector.tsx b/apps/desktop/src/app/capabilities/scope-selector.tsx
new file mode 100644
index 00000000000..a844ea0133e
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/scope-selector.tsx
@@ -0,0 +1,216 @@
+import { useStore } from '@nanostores/react'
+import { useQuery } from '@tanstack/react-query'
+import { useMemo, useState } from 'react'
+
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
+import type { DesktopRosterAgent } from '@/global'
+import { getProfiles, type ProfileScope, profileScopeKey } from '@/hermes'
+import { useI18n } from '@/i18n'
+import { cn } from '@/lib/utils'
+import { activeGatewayConnectionId } from '@/store/gateway'
+import { $activeGatewayProfile, normalizeProfileKey } from '@/store/profile'
+
+import { useOnProfileSwitch } from '../hooks/use-on-profile-switch'
+
+interface ScopeOption {
+ key: string
+ label: string
+ value: string
+}
+
+export interface CapabilityScope {
+ /** Which profile's Skills/Tools/MCP config every tab reads and writes — and
+ * on WHICH gateway. */
+ profile: ProfileScope
+ /** Cache-key form of `profile`: every scoped query key ends with it, and the
+ * tabs are keyed on it so a scope change is a fresh tab. */
+ key: string
+ /** Scoped to a DIFFERENT backend than the window's active gateway? The MCP
+ * tab's live-reload RPC rides the active gateway socket, which would reload
+ * the wrong machine — it is withheld for cross-backend scopes. */
+ crossBackend: boolean
+ /** Display name of the selected profile (the Plugins tab's Agent column). */
+ label?: string
+ options: ScopeOption[]
+ value: string
+ onChange: (value: string) => void
+}
+
+/**
+ * The Capabilities scope: which profile's config the page is editing, and on
+ * which gateway. A profile belongs to one gateway, so on a multi-connection
+ * desktop the selector offers every (connection, profile) pair from the union
+ * agent roster and an explicit pick routes every read/write to that machine's
+ * backend. Defaults to the app-wide active profile. A `fixedProfile` (+
+ * optional `fixedConnection`) pins the scope outright, selector hidden.
+ */
+export function useCapabilityScope({
+ fixedConnection,
+ fixedProfile
+}: {
+ fixedConnection?: string
+ fixedProfile?: string
+}): CapabilityScope {
+ const activeProfile = useStore($activeGatewayProfile)
+ const [scopeOverride, setScopeOverride] = useState<null | string | { connectionId: string; profile: string }>(null)
+
+ const scopeProfile: ProfileScope = useMemo(
+ () =>
+ fixedProfile
+ ? fixedConnection
+ ? { connectionId: fixedConnection, profile: fixedProfile }
+ : fixedProfile
+ : (scopeOverride ?? activeProfile ?? null),
+ [activeProfile, fixedConnection, fixedProfile, scopeOverride]
+ )
+
+ const scopeKey = profileScopeKey(scopeProfile)
+
+ // The registry connection an explicit override pins — null for the ambient
+ // active-profile path and for fixed-profile pins without a connection.
+ const scopeConnectionId =
+ scopeProfile && typeof scopeProfile === 'object' ? (scopeProfile.connectionId ?? '').trim() || 'local' : null
+
+ const { data: profilesData } = useQuery({
+ queryKey: ['capabilities-profiles'],
+ queryFn: () => getProfiles(),
+ staleTime: 60_000,
+ // Pinned scope never shows the selector, so don't fetch the roster for it.
+ enabled: !fixedProfile
+ })
+
+ // v2 multi-connection registry: cheap local IPC to learn whether more than
+ // one gateway is registered. Only then is the (heavier) union agent roster
+ // fetched to feed the selector — single-connection setups keep the exact
+ // legacy profiles list. Both feature-detected for older Electron mains.
+ const registryBridge = window.hermesDesktop?.connections
+ const rosterBridge = window.hermesDesktop?.getAgentRoster
+
+ const { data: registryData } = useQuery({
+ queryKey: ['capabilities-connections-registry'],
+ queryFn: () => registryBridge!.list(),
+ staleTime: 60_000,
+ enabled: !fixedProfile && Boolean(registryBridge) && Boolean(rosterBridge)
+ })
+
+ const multiConnection = (registryData?.connections.length ?? 0) > 1
+
+ const { data: rosterData } = useQuery({
+ queryKey: ['capabilities-agent-roster'],
+ queryFn: () => rosterBridge!(),
+ staleTime: 60_000,
+ enabled: !fixedProfile && multiConnection
+ })
+
+ // An app-wide profile switch drops any scope override — the user just
+ // changed what "here" means, and a stale override pointing at the previous
+ // selection would be surprising.
+ useOnProfileSwitch(() => setScopeOverride(null))
+
+ // Scope-selector rows. Multi-connection desktops list every reachable
+ // (connection, profile) agent from the union roster — the selected profile
+ // is configured ON ITS OWN GATEWAY. Otherwise the legacy per-profile list.
+ const options: ScopeOption[] = useMemo(() => {
+ if (multiConnection && rosterData?.agents?.length) {
+ const activeId = activeGatewayConnectionId() ?? 'local'
+
+ return rosterData.agents.map((agent: DesktopRosterAgent) => ({
+ key: `${agent.connectionId}::${agent.profile}`,
+ label:
+ agent.connectionId === activeId
+ ? `${agent.profile} — ${agent.connectionLabel} (current)`
+ : `${agent.profile} — ${agent.connectionLabel}`,
+ value: `${agent.connectionId}::${agent.profile}`
+ }))
+ }
+
+ return (profilesData?.profiles ?? []).map(p => ({
+ key: p.name,
+ label: p.is_default ? 'Hermes (default)' : p.name,
+ value: p.name
+ }))
+ }, [multiConnection, profilesData, rosterData])
+
+ // The selector's current value must match one option's value exactly. On the
+ // roster path an ambient (non-override) scope is the active gateway's
+ // profile, which lives at `activeConnectionId::profile`.
+ const value = useMemo(() => {
+ if (scopeProfile && typeof scopeProfile === 'object') {
+ return `${(scopeProfile.connectionId ?? '').trim() || 'local'}::${scopeProfile.profile ?? ''}`
+ }
+
+ if (multiConnection && rosterData?.agents?.length) {
+ return `${activeGatewayConnectionId() ?? 'local'}::${normalizeProfileKey(scopeProfile)}`
+ }
+
+ return scopeProfile ?? ''
+ }, [multiConnection, rosterData, scopeProfile])
+
+ // Selector option values are `connectionId::profile` on multi-connection
+ // desktops (the roster path) and bare profile names otherwise, so one
+ // handler decodes both.
+ const onChange = (picked: string) => {
+ const sep = picked.indexOf('::')
+
+ // Roster picks (`connectionId::profile`) stay objects — a `local::` pick
+ // must PIN the local pool even while a remote gateway is active. Legacy
+ // bare-name picks stay strings so cache keys and routing are unchanged.
+ const next: ProfileScope =
+ sep >= 0 ? { connectionId: picked.slice(0, sep), profile: picked.slice(sep + 2) } : picked
+
+ if (profileScopeKey(next) === scopeKey) {
+ return
+ }
+
+ setScopeOverride(next as string | { connectionId: string; profile: string })
+ }
+
+ return {
+ crossBackend: scopeConnectionId !== null && scopeConnectionId !== (activeGatewayConnectionId() ?? 'local'),
+ key: scopeKey,
+ label: options.find(option => option.value === value)?.label,
+ onChange,
+ options,
+ profile: scopeProfile,
+ value
+ }
+}
+
+/**
+ * Scope selector, shown above EVERY Capabilities tab (Skills, Tools, MCP,
+ * Plugins). Lets the user configure ANY profile's capabilities — on any
+ * registered gateway — without switching the whole app. Only meaningful with
+ * >1 option; hidden otherwise to avoid clutter.
+ */
+export function CapabilityScopeSelector({
+ compact = false,
+ scope
+}: {
+ /** In Plugins, the selector belongs only to the Agent column. */
+ compact?: boolean
+ scope: CapabilityScope
+}) {
+ const { t } = useI18n()
+
+ if (scope.options.length <= 1) {
+ return null
+ }
+
+ return (
+ <div className={cn('flex min-w-0 items-center gap-2', compact ? 'flex-1' : 'border-b border-(--ui-stroke-secondary) px-3 py-2')}>
+ {!compact && <span className="text-[0.7rem] font-medium text-(--ui-text-tertiary)">{t.skills.configuringProfile}</span>}
+ <Select onValueChange={scope.onChange} value={scope.value}>
+ <SelectTrigger className={cn('text-xs', compact ? 'h-6 w-full max-w-64 px-2' : 'h-7 w-56')}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {scope.options.map(option => (
+ <SelectItem key={option.key} value={option.value}>
+ {option.label}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ )
+}
diff --git a/apps/desktop/src/app/skills/embedded-hub-picker.tsx b/apps/desktop/src/app/capabilities/skills/embedded-hub-picker.tsx
similarity index 100%
rename from apps/desktop/src/app/skills/embedded-hub-picker.tsx
rename to apps/desktop/src/app/capabilities/skills/embedded-hub-picker.tsx
diff --git a/apps/desktop/src/app/capabilities/skills/frontmatter.test.ts b/apps/desktop/src/app/capabilities/skills/frontmatter.test.ts
new file mode 100644
index 00000000000..02b8ca634aa
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/skills/frontmatter.test.ts
@@ -0,0 +1,28 @@
+import { describe, expect, it } from 'vitest'
+
+import { parseFrontmatter } from './frontmatter'
+
+describe('parseFrontmatter', () => {
+ it('splits the leading YAML block from the body', () => {
+ const { body, meta } = parseFrontmatter('---\nname: web-research\nversion: 1.2.0\n---\n\n# Web Research\n\nSteps.')
+
+ expect(meta).toEqual([
+ ['name', 'web-research'],
+ ['version', '1.2.0']
+ ])
+ expect(body.trim()).toBe('# Web Research\n\nSteps.')
+ })
+
+ it('keeps a nested block with its key, de-indented one level', () => {
+ const { meta } = parseFrontmatter('---\nallowed-tools:\n - Read\n - Write\nname: x\n---\nbody')
+
+ expect(meta).toEqual([
+ ['allowed-tools', '- Read\n- Write'],
+ ['name', 'x']
+ ])
+ })
+
+ it('returns the whole content as body when there is no frontmatter', () => {
+ expect(parseFrontmatter('# Just a skill')).toEqual({ body: '# Just a skill', meta: [] })
+ })
+})
diff --git a/apps/desktop/src/app/capabilities/skills/frontmatter.ts b/apps/desktop/src/app/capabilities/skills/frontmatter.ts
new file mode 100644
index 00000000000..00e1b2657cb
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/skills/frontmatter.ts
@@ -0,0 +1,39 @@
+// Frontmatter parse for display: the YAML block between the leading `---`
+// fences, flattened to top-level `key: value` rows (nested blocks render as
+// their raw indented text). Display-only — never fed back to the backend.
+export function parseFrontmatter(content: string): { body: string; meta: [string, string][] } {
+ const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(content)
+
+ if (!match) {
+ return { body: content, meta: [] }
+ }
+
+ const meta: [string, string][] = []
+ let currentKey: null | string = null
+ let block: string[] = []
+
+ const flush = () => {
+ if (currentKey !== null) {
+ meta.push([currentKey, block.join('\n').trim()])
+ }
+
+ currentKey = null
+ block = []
+ }
+
+ for (const line of match[1].split(/\r?\n/)) {
+ const kv = /^(\w[\w-]*):\s?(.*)$/.exec(line)
+
+ if (kv) {
+ flush()
+ currentKey = kv[1]
+ block = kv[2] ? [kv[2]] : []
+ } else if (currentKey !== null) {
+ block.push(line.replace(/^ {2}/, ''))
+ }
+ }
+
+ flush()
+
+ return { body: content.slice(match[0].length), meta }
+}
diff --git a/apps/desktop/src/app/capabilities/skills/official-skill-detail.tsx b/apps/desktop/src/app/capabilities/skills/official-skill-detail.tsx
new file mode 100644
index 00000000000..533e5a99d96
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/skills/official-skill-detail.tsx
@@ -0,0 +1,83 @@
+import { useQuery } from '@tanstack/react-query'
+import { useMemo } from 'react'
+
+import { Button } from '@/components/ui/button'
+import { CountSkeleton } from '@/components/ui/skeleton'
+import { previewSkillHub, type ProfileScope, profileScopeKey } from '@/hermes'
+import { useI18n } from '@/i18n'
+import { Loader2 } from '@/lib/icons'
+import type { OfficialSkillInfo } from '@/types/hermes'
+
+import { PanelPill } from '../../overlays/panel'
+import { asText, prettyName } from '../../settings/helpers'
+import { DetailHeader } from '../primitives'
+
+import { parseFrontmatter } from './frontmatter'
+
+// Detail pane for a not-yet-installed catalog skill.
+export function OfficialSkillDetail({
+ installing,
+ onInstall,
+ profile,
+ skill
+}: {
+ installing: boolean
+ onInstall: () => void
+ profile?: ProfileScope
+ skill: OfficialSkillInfo
+}) {
+ const { t } = useI18n()
+
+ const previewQuery = useQuery({
+ queryKey: ['official-skill-preview', skill.identifier, profileScopeKey(profile)],
+ queryFn: () => previewSkillHub(skill.identifier, profile),
+ staleTime: 5 * 60_000,
+ retry: false
+ })
+
+ const parsed = useMemo(
+ () => (previewQuery.data?.skill_md ? parseFrontmatter(previewQuery.data.skill_md) : null),
+ [previewQuery.data]
+ )
+
+ return (
+ <>
+ <DetailHeader
+ description={asText(skill.description) || t.skills.noDescription}
+ pills={
+ <>
+ <PanelPill>{prettyName(skill.category)}</PanelPill>
+ <PanelPill tone="muted">{t.skills.officialPill}</PanelPill>
+ </>
+ }
+ title={skill.name}
+ />
+ <div className="flex items-center gap-2">
+ <Button disabled={installing} onClick={onInstall} size="xs" variant="textStrong">
+ {installing && <Loader2 className="size-3 animate-spin" />}
+ {installing ? t.skills.hub.installing : t.skills.hub.install}
+ </Button>
+ </div>
+ {parsed && parsed.meta.length > 0 && (
+ <div className="grid gap-1 rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) p-3">
+ {parsed.meta.map(([key, value]) => (
+ <div className="flex gap-2 text-[0.68rem] leading-4" key={key}>
+ <span className="w-24 shrink-0 font-medium text-(--ui-text-tertiary)">{key}</span>
+ <span className="min-w-0 whitespace-pre-wrap break-words text-(--ui-text-secondary)">{value}</span>
+ </div>
+ ))}
+ </div>
+ )}
+ {previewQuery.isLoading ? (
+ <CountSkeleton />
+ ) : parsed ? (
+ <pre
+ className="overflow-auto whitespace-pre-wrap wrap-break-word rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) p-3 font-mono text-[0.68rem] leading-relaxed"
+ data-selectable-text="true"
+ >
+ {parsed.body.trim() || t.skills.noDescription}
+ </pre>
+ ) : null}
+ </>
+ )
+}
diff --git a/apps/desktop/src/app/capabilities/skills/skill-detail.tsx b/apps/desktop/src/app/capabilities/skills/skill-detail.tsx
new file mode 100644
index 00000000000..483d01e48fb
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/skills/skill-detail.tsx
@@ -0,0 +1,95 @@
+import { useQuery } from '@tanstack/react-query'
+import { useMemo } from 'react'
+
+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 { categoryFor } from './skills-data'
+
+export function SkillDetail({
+ onArchive,
+ onEdit,
+ profile,
+ skill
+}: {
+ onArchive: () => void
+ onEdit: () => void
+ profile?: ProfileScope
+ skill: SkillInfo
+}) {
+ const { t } = useI18n()
+ // Only learned/local skills are the user's to rewrite or archive — bundled
+ // and hub skills are managed by their sources.
+ const editable = skill.provenance === 'agent'
+
+ // The FULL skill — frontmatter metadata + complete SKILL.md body — for any
+ // provenance, scoped to the Capabilities profile selector. The row list only
+ // carries name/description; the pane shows the whole thing.
+ const contentQuery = useQuery({
+ queryKey: ['skill-content', skill.name, profileScopeKey(profile)],
+ queryFn: () => getSkillContent(skill.name, profile),
+ staleTime: 60_000
+ })
+
+ const parsed = useMemo(
+ () => (contentQuery.data ? parseFrontmatter(contentQuery.data.content) : null),
+ [contentQuery.data]
+ )
+
+ return (
+ <>
+ <DetailHeader
+ description={asText(skill.description) || t.skills.noDescription}
+ pills={
+ <>
+ <PanelPill>{prettyName(categoryFor(skill))}</PanelPill>
+ {skill.provenance && skill.provenance !== 'bundled' && (
+ <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">
+ {t.skills.edit}
+ </Button>
+ <Button className="text-destructive hover:text-destructive" onClick={onArchive} size="xs" variant="text">
+ {t.skills.archive}
+ </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 ? (
+ <CountSkeleton />
+ ) : parsed ? (
+ <pre
+ className="overflow-auto whitespace-pre-wrap wrap-break-word rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) p-3 font-mono text-[0.68rem] leading-relaxed"
+ data-selectable-text="true"
+ >
+ {parsed.body.trim() || t.skills.noDescription}
+ </pre>
+ ) : null}
+ </>
+ )
+}
diff --git a/apps/desktop/src/app/capabilities/skills/skills-data.ts b/apps/desktop/src/app/capabilities/skills/skills-data.ts
new file mode 100644
index 00000000000..14075c4ba44
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/skills/skills-data.ts
@@ -0,0 +1,76 @@
+import { useQuery } from '@tanstack/react-query'
+
+import { getSkills, type ProfileScope, profileScopeKey } from '@/hermes'
+import { normalize } from '@/lib/text'
+import type { OfficialSkillInfo, SkillInfo } from '@/types/hermes'
+
+import { asText, includesQuery } from '../../settings/helpers'
+
+// Skills live in the RQ cache so switching tabs/pages paints the cached list
+// instantly (no reload flash) and mount only fires a deduped background
+// refetch. A profile swap globally invalidates (see store/profile), so this
+// plain key refetches against the new backend automatically.
+// `store/hub-actions` invalidates it after a hub (un)install — it imports this
+// constant rather than re-spelling the key.
+export const SKILLS_QUERY_KEY = ['skills-list'] as const
+
+/** The list key for one scope: the plain key plus the Capabilities scope key,
+ * so every scoped profile keeps its own cached copy (prefix invalidations
+ * still match). */
+export const skillsQueryKey = (profile: ProfileScope) => [...SKILLS_QUERY_KEY, profileScopeKey(profile)]
+
+export function useSkillsQuery(profile: ProfileScope) {
+ return useQuery({
+ queryKey: skillsQueryKey(profile),
+ queryFn: () => getSkills(profile),
+ staleTime: 0
+ })
+}
+
+export const usageOf = (skill: SkillInfo): number => (typeof skill.usage === 'number' ? skill.usage : 0)
+
+export const categoryFor = (skill: SkillInfo): string => asText(skill.category) || 'general'
+
+// Catalog rows have no usage yet — plain A–Z, with tags as searchable metadata.
+export function filteredOfficial(skills: OfficialSkillInfo[], query: string): OfficialSkillInfo[] {
+ const q = normalize(query)
+
+ return skills
+ .filter(
+ skill =>
+ !q ||
+ includesQuery(skill.name, q) ||
+ includesQuery(skill.description, q) ||
+ includesQuery(skill.category, q) ||
+ skill.tags.some(tag => includesQuery(tag, q))
+ )
+ .sort((a, b) => asText(a.name).localeCompare(asText(b.name)))
+}
+
+export function filteredSkills(skills: SkillInfo[], query: string, desc: boolean): SkillInfo[] {
+ const q = normalize(query)
+ const sign = desc ? 1 : -1
+
+ return skills
+ .filter(
+ skill =>
+ !q || includesQuery(skill.name, q) || includesQuery(skill.description, q) || includesQuery(skill.category, q)
+ )
+ .sort((a, b) => sign * (usageOf(b) - usageOf(a)) || asText(a.name).localeCompare(asText(b.name)))
+}
+
+/** The user's busiest categories, for the search field's rotating placeholder
+ * nudges — they teach that search understands categories, not just titles. */
+export function skillSearchTerms(skills: SkillInfo[]): string[] {
+ const counts = new Map<string, number>()
+
+ for (const skill of skills) {
+ const key = categoryFor(skill)
+ counts.set(key, (counts.get(key) || 0) + 1)
+ }
+
+ return [...counts.entries()]
+ .sort(([, a], [, b]) => b - a)
+ .slice(0, 5)
+ .map(([category]) => category.toLowerCase())
+}
diff --git a/apps/desktop/src/app/capabilities/skills/skills-tab.tsx b/apps/desktop/src/app/capabilities/skills/skills-tab.tsx
new file mode 100644
index 00000000000..639dfc46176
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/skills/skills-tab.tsx
@@ -0,0 +1,381 @@
+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 { 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 { 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'
+
+// 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)
+
+// 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[]
+ /** The (connection, profile) scope every read and write routes to. */
+ profile: ProfileScope
+ query: string
+ /** Page-level refresh: a saved skill edit reloads the same way the refresh
+ * hotkey does, counts and slash completions included. */
+ onRefresh: () => void
+}
+
+/** The Skills tab: installed skills, official optional skills, and learned-skill editing. */
+export function SkillsTab({ onRefresh, profile, query, skills }: SkillsTabProps) {
+ const { t } = useI18n()
+ 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)
+
+ // 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]
+ )
+
+ 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
+ }
+
+ setBulkBusy(true)
+
+ let done = 0
+
+ try {
+ for (const row of targets) {
+ await setSkillEnabled(row.name, enabled, profile)
+ setSkills(cur => cur?.map(r => (r.name === row.name ? { ...r, enabled } : r)) ?? cur)
+ done += 1
+ }
+
+ notify({ kind: 'success', title: t.skills.bulkUpdated(done), message: '' })
+ } catch (err) {
+ notifyError(err, t.skills.failedToUpdate(t.skills.tabSkills))
+ } finally {
+ invalidateSlashCompletions()
+ setBulkBusy(false)
+ }
+ }
+
+ // 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)
+
+ // One switch line covering enable-all/disable-all.
+ const bulkSwitch: ListStripMenuToggle = {
+ checked: allEnabled,
+ disabled: bulkBusy,
+ label: t.skills.all,
+ onToggle: checked => void bulkApply(skills.filter(row => row.enabled !== checked), checked)
+ }
+
+ // "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)
+
+ setSkillEditor({ content: node.content, name })
+ setSkillDraft(node.content)
+ } catch (err) {
+ notifyError(err, name)
+ }
+ }
+
+ const saveSkillEdit = async () => {
+ if (!skillEditor) {
+ return
+ }
+
+ setSkillSaving(true)
+
+ try {
+ await editLearningNode(skillEditor.name, skillDraft, profile)
+ notify({
+ kind: 'success',
+ title: t.skills.skillUpdated,
+ message: t.skills.appliesToNewSessions(skillEditor.name)
+ })
+ setSkillEditor(null)
+ onRefresh()
+ } catch (err) {
+ notifyError(err, skillEditor.name)
+ } finally {
+ setSkillSaving(false)
+ }
+ }
+
+ 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 (
+ <>
+ {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}
+ />
+ }
+ />
+ }
+ >
+ {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>
+ )}
+ {visibleOfficial.map(skill => {
+ const installing = runningInstalls.has(skill.identifier)
+
+ return (
+ <CapRow
+ action={
+ <Button
+ disabled={installing}
+ onClick={() => handleInstallOfficial(skill)}
+ size="xs"
+ variant="text"
+ >
+ {installing && <Loader2 className="size-3 animate-spin" />}
+ {installing ? t.skills.hub.installing : t.skills.hub.install}
+ </Button>
+ }
+ active={activeOfficial?.identifier === skill.identifier}
+ enabled={false}
+ key={skill.identifier}
+ onSelect={() => setSelectedOfficial(skill.identifier)}
+ subtitle={prettyName(skill.category)}
+ title={skill.name}
+ />
+ )
+ })}
+ </ListColumn>
+ <DetailColumn footer={t.skills.changesApplyNewSessions}>
+ {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}
+ />
+ )
+ )}
+ </DetailColumn>
+ </MasterDetail>
+ )}
+ {archiveTarget && (
+ <ArchiveSkillConfirmDialog
+ onApply={() => {
+ const name = archiveTarget
+ const snapshot = skills
+
+ setSkills(current => current?.filter(skill => skill.name !== name) ?? current)
+ invalidateSlashCompletions()
+
+ if (skillEditor?.name === name) {
+ setSkillEditor(null)
+ }
+
+ return () => setSkills(() => snapshot)
+ }}
+ onClose={() => setArchiveTarget(null)}
+ onFailure={(err, name) => notifyError(err, name)}
+ open
+ profile={profile}
+ skillId={archiveTarget}
+ skillName={archiveTarget}
+ />
+ )}
+ </>
+ )
+}
diff --git a/apps/desktop/src/app/capabilities/toolsets/tool-calls.ts b/apps/desktop/src/app/capabilities/toolsets/tool-calls.ts
new file mode 100644
index 00000000000..8958c117040
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/toolsets/tool-calls.ts
@@ -0,0 +1,77 @@
+import { useStore } from '@nanostores/react'
+import { atom } from 'nanostores'
+import { useEffect, useState } from 'react'
+
+import { getUsageAnalytics, type ProfileScope, profileScopeKey } from '@/hermes'
+
+// Per-tool call counts come from a 365-day message scan — heavy, and purely
+// cosmetic (Toolsets usage badges). Cache the result module-wide with a TTL so
+// bouncing between tabs/pages doesn't re-run the scan every time. Keyed by
+// the Capabilities scope profile: analytics are profile-scoped, so a scope or
+// app-profile switch must not show the previous profile's counts.
+const TOOL_CALLS_TTL_MS = 10 * 60 * 1000
+const toolCallsCache = new Map<string, { at: number; value: Record<string, number> }>()
+
+// Bumped once a forced pull has landed in the cache, so badges already on
+// screen pick the fresh counts up instead of sitting out the TTL.
+const $toolCallsRefreshed = atom(0)
+
+async function loadToolCalls(
+ scopeKey: string,
+ scopeProfile: ProfileScope,
+ force = false
+): Promise<Record<string, number>> {
+ const cached = toolCallsCache.get(scopeKey)
+
+ if (!force && cached && Date.now() - cached.at < TOOL_CALLS_TTL_MS) {
+ return cached.value
+ }
+
+ const analytics = await getUsageAnalytics(365, scopeProfile)
+
+ const value = Object.fromEntries((analytics.tools ?? []).map(e => [e.tool, e.count]))
+
+ toolCallsCache.set(scopeKey, { at: Date.now(), value })
+
+ return value
+}
+
+/** The page refresh's analytics leg (`useRefreshHotkey`): the one time the TTL
+ * is bypassed — but only if the badges have been on screen at least once;
+ * otherwise let the lazy load pick the counts up when Toolsets is first
+ * shown. */
+export async function refreshToolCalls(profile: ProfileScope): Promise<void> {
+ if (toolCallsCache.size === 0) {
+ return
+ }
+
+ await loadToolCalls(profileScopeKey(profile), profile, true).catch(() => undefined)
+ $toolCallsRefreshed.set($toolCallsRefreshed.get() + 1)
+}
+
+/**
+ * tool name -> call count over the analytics window. `null` = still loading
+ * (badges show skeletons); `{}` = loaded empty / unavailable backend.
+ *
+ * Mounting the Toolsets tab is what asks for the scan, so Skills and MCP never
+ * pay for it and it can't starve the MCP tab's config load. A scope change
+ * remounts the tab, so a slow load from the previous scope can never land on
+ * the new one's badges.
+ */
+export function useToolCalls(profile: ProfileScope): null | Record<string, number> {
+ const refreshed = useStore($toolCallsRefreshed)
+ const [toolCalls, setToolCalls] = useState<null | Record<string, number>>(null)
+ const scopeKey = profileScopeKey(profile)
+
+ useEffect(() => {
+ let cancelled = false
+
+ loadToolCalls(scopeKey, profile)
+ .then(value => !cancelled && setToolCalls(value))
+ .catch(() => !cancelled && setToolCalls({}))
+
+ return () => void (cancelled = true)
+ }, [profile, refreshed, scopeKey])
+
+ return toolCalls
+}
diff --git a/apps/desktop/src/app/capabilities/toolsets/toolset-detail.tsx b/apps/desktop/src/app/capabilities/toolsets/toolset-detail.tsx
new file mode 100644
index 00000000000..de16e13ea46
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/toolsets/toolset-detail.tsx
@@ -0,0 +1,89 @@
+import { compactNumber } from '@hermes/shared'
+import { useNavigate } from 'react-router'
+
+import { Button } from '@/components/ui/button'
+import { type ProfileScope, profileScopeKey } from '@/hermes'
+import { useI18n } from '@/i18n'
+import type { ToolsetInfo } from '@/types/hermes'
+
+import { ToolChip } from '../../master-detail'
+import { PanelPill } from '../../overlays/panel'
+import { SETTINGS_ROUTE } from '../../routes'
+import { BrowserRealProfilePanel } from '../../settings/browser-real-profile-panel'
+import { ComputerUsePanel } from '../../settings/computer-use-panel'
+import { asText, toolNames, toolsetDisplayLabel } from '../../settings/helpers'
+import { TerminalBackendPanel } from '../../settings/terminal-backend-panel'
+import { ToolsetConfigPanel } from '../../settings/toolset-config-panel'
+import { DetailHeader } from '../primitives'
+
+export function ToolsetDetail({
+ toolset,
+ toolCalls,
+ onConfiguredChange,
+ profile
+}: {
+ toolset: ToolsetInfo
+ toolCalls: Record<string, number>
+ onConfiguredChange: () => void
+ profile?: ProfileScope
+}) {
+ const { t } = useI18n()
+ const navigate = useNavigate()
+ const tools = toolNames(toolset)
+ const label = toolsetDisplayLabel(toolset)
+
+ return (
+ <>
+ {/* "Configured" as a resting state is noise — only the warn state earns a pill. */}
+ <DetailHeader
+ description={asText(toolset.description) || t.skills.noDescription}
+ pills={!toolset.configured && <PanelPill tone="warn">{t.skills.needsKeys}</PanelPill>}
+ title={label}
+ />
+ {tools.length > 0 && (
+ <div className="flex flex-wrap gap-1">
+ {tools.map(name => (
+ <ToolChip key={name}>
+ {name}
+ {(toolCalls[name] ?? 0) > 0 && (
+ <span className="ml-1 text-(--ui-text-quaternary)">×{compactNumber(toolCalls[name])}</span>
+ )}
+ </ToolChip>
+ ))}
+ </div>
+ )}
+ {toolset.name === 'vision' && (
+ // Vision has no provider matrix — model resolution runs through the
+ // auxiliary model config. Point at the actual home (Settings → Models,
+ // aux "vision" row) via an internal deep link instead of leaving the
+ // detail pane empty.
+ <div className="grid gap-1.5">
+ <p className="text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
+ {t.skills.visionModelHint}
+ </p>
+ <div>
+ <Button
+ onClick={() => navigate(`${SETTINGS_ROUTE}?tab=config:model&aux=vision`)}
+ size="xs"
+ variant="textStrong"
+ >
+ {t.skills.visionModelLink}
+ </Button>
+ </div>
+ </div>
+ )}
+ {toolset.name === 'computer_use' && <ComputerUsePanel onConfiguredChange={onConfiguredChange} />}
+ {/* Real-profile consent toggle ABOVE the backend/provider matrix — the
+ config option users kept missing because its only GUI home was the
+ generic Settings → Config editor. */}
+ {toolset.name === 'browser' && <BrowserRealProfilePanel profile={profile} />}
+ {toolset.name === 'terminal' && <TerminalBackendPanel onConfiguredChange={onConfiguredChange} />}
+ <ToolsetConfigPanel
+ key={`${toolset.name}:${profileScopeKey(profile)}`}
+ onConfiguredChange={onConfiguredChange}
+ profile={profile}
+ toolset={toolset.name}
+ />
+ </>
+ )
+}
diff --git a/apps/desktop/src/app/capabilities/toolsets/toolsets-data.ts b/apps/desktop/src/app/capabilities/toolsets/toolsets-data.ts
new file mode 100644
index 00000000000..568e74a6328
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/toolsets/toolsets-data.ts
@@ -0,0 +1,75 @@
+import { useQuery } from '@tanstack/react-query'
+
+import { getToolsets, type ProfileScope, profileScopeKey } from '@/hermes'
+import { isDesktopToolsetVisible } from '@/lib/desktop-toolsets'
+import { normalize } from '@/lib/text'
+import type { ToolsetInfo } from '@/types/hermes'
+
+import { includesQuery, toolNames, toolsetDisplayLabel } from '../../settings/helpers'
+
+// Toolsets live in the RQ cache so switching tabs/pages paints the cached list
+// instantly (no reload flash) and mount only fires a deduped background
+// refetch. A profile swap globally invalidates (see store/profile), so this
+// plain key refetches against the new backend automatically.
+export const TOOLSETS_QUERY_KEY = ['toolsets-list'] as const
+
+/** The list key for one scope: the plain key plus the Capabilities scope key,
+ * so every scoped profile keeps its own cached copy (prefix invalidations
+ * still match). */
+export const toolsetsQueryKey = (profile: ProfileScope) => [...TOOLSETS_QUERY_KEY, profileScopeKey(profile)]
+
+export function useToolsetsQuery(profile: ProfileScope) {
+ return useQuery({
+ queryKey: toolsetsQueryKey(profile),
+ queryFn: () => getToolsets(profile),
+ staleTime: 0
+ })
+}
+
+export const toolsetCalls = (toolset: ToolsetInfo, toolCalls: Record<string, number>): number =>
+ toolNames(toolset).reduce((sum, name) => sum + (toolCalls[name] ?? 0), 0)
+
+export function filteredToolsets(
+ toolsets: ToolsetInfo[],
+ query: string,
+ toolCalls: Record<string, number>,
+ desc: boolean
+): ToolsetInfo[] {
+ const q = normalize(query)
+ const sign = desc ? 1 : -1
+
+ return toolsets
+ .filter(toolset => {
+ if (!isDesktopToolsetVisible(toolset.name)) {
+ return false
+ }
+
+ if (!q) {
+ return true
+ }
+
+ return (
+ includesQuery(toolset.name, q) ||
+ includesQuery(toolsetDisplayLabel(toolset), q) ||
+ includesQuery(toolset.description, q) ||
+ toolNames(toolset).some(name => includesQuery(name, q))
+ )
+ })
+ .sort(
+ (a, b) =>
+ sign * (toolsetCalls(b, toolCalls) - toolsetCalls(a, toolCalls)) ||
+ toolsetDisplayLabel(a).localeCompare(toolsetDisplayLabel(b))
+ )
+}
+
+export const visibleToolsetCount = (toolsets: ToolsetInfo[]) =>
+ toolsets.filter(ts => isDesktopToolsetVisible(ts.name)).length
+
+/** Tool names for the search field's rotating placeholder nudges — they teach
+ * that search understands tool names, not just titles. */
+export function toolsetSearchTerms(toolsets: ToolsetInfo[]): string[] {
+ return toolsets
+ .filter(ts => isDesktopToolsetVisible(ts.name) && toolNames(ts).length > 0)
+ .slice(0, 5)
+ .map(ts => toolNames(ts)[0])
+}
diff --git a/apps/desktop/src/app/capabilities/toolsets/toolsets-tab.tsx b/apps/desktop/src/app/capabilities/toolsets/toolsets-tab.tsx
new file mode 100644
index 00000000000..2c9abe1ebe5
--- /dev/null
+++ b/apps/desktop/src/app/capabilities/toolsets/toolsets-tab.tsx
@@ -0,0 +1,192 @@
+import { compactNumber } from '@hermes/shared'
+import { useStore } from '@nanostores/react'
+import { useCallback, useMemo, useState } from 'react'
+
+import { CountSkeleton } from '@/components/ui/skeleton'
+import { type ProfileScope, setToolsetEnabled } from '@/hermes'
+import { useI18n } from '@/i18n'
+import { isDesktopToolsetVisible } from '@/lib/desktop-toolsets'
+import { Codecs, persistentAtom } from '@/lib/persisted'
+import { queryClient } from '@/lib/query-client'
+import { invalidateSlashCompletions } from '@/lib/slash-completion-cache'
+import { notify, notifyError } from '@/store/notifications'
+import type { ToolsetInfo } from '@/types/hermes'
+
+import {
+ CapRow,
+ DetailColumn,
+ ListColumn,
+ ListStrip,
+ ListStripMenu,
+ type ListStripMenuToggle,
+ MasterDetail
+} from '../../master-detail'
+import { asText, toolNames, toolsetDisplayLabel } from '../../settings/helpers'
+import { CapabilityEmpty, SortButton } from '../primitives'
+
+import { useToolCalls } from './tool-calls'
+import { ToolsetDetail } from './toolset-detail'
+import { filteredToolsets, toolsetCalls, TOOLSETS_QUERY_KEY, toolsetsQueryKey } from './toolsets-data'
+
+// Sort direction for the Tools list — persisted so the tab remembers
+// most/least-used across navigations and restarts.
+const $toolsetsSortDesc = persistentAtom('hermes.desktop.capabilities.toolsetsSortDesc', true, Codecs.bool)
+
+interface ToolsetsTabProps {
+ /** The scope's toolset list, straight from the shell's query. */
+ toolsets: ToolsetInfo[]
+ /** The (connection, profile) scope every read and write routes to. */
+ profile: ProfileScope
+ query: string
+}
+
+/** THE Tools tab: the toolset list with its usage badges, and the inspector
+ * that mounts each toolset's settings panels. */
+export function ToolsetsTab({ profile, query, toolsets }: ToolsetsTabProps) {
+ const { t } = useI18n()
+ const toolsetsSortDesc = useStore($toolsetsSortDesc)
+ const toolCalls = useToolCalls(profile)
+ const [bulkBusy, setBulkBusy] = useState(false)
+ const [selectedToolset, setSelectedToolset] = useState<string | null>(null)
+
+ // Optimistic write-through against the scoped Tools key: toggles repaint
+ // instantly; the next background refetch reconciles.
+ const setToolsets = useCallback(
+ (fn: (cur: ToolsetInfo[] | undefined) => ToolsetInfo[] | undefined) =>
+ queryClient.setQueryData<ToolsetInfo[]>(toolsetsQueryKey(profile), prev => fn(prev) ?? prev),
+ [profile]
+ )
+
+ const refreshToolsets = useCallback(() => {
+ void queryClient.invalidateQueries({ queryKey: TOOLSETS_QUERY_KEY })
+ }, [])
+
+ // Absent counts sort the list A–Z until the analytics scan lands.
+ const visibleToolsets = useMemo(
+ () => filteredToolsets(toolsets, query, toolCalls ?? {}, toolsetsSortDesc),
+ [query, toolCalls, toolsets, toolsetsSortDesc]
+ )
+
+ // Bulk actions 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 bulkToolsets = useMemo(() => toolsets.filter(ts => isDesktopToolsetVisible(ts.name)), [toolsets])
+
+ // Keep a valid selection: fall back to the first visible row when the
+ // current selection is filtered out (or nothing is selected yet).
+ const activeToolset = useMemo(
+ () => visibleToolsets.find(ts => ts.name === selectedToolset) ?? visibleToolsets[0] ?? null,
+ [selectedToolset, visibleToolsets]
+ )
+
+ // Single toggles are optimistic and silent on success (the row repaints
+ // immediately — a toast per flip would spam rapid customization). Errors
+ // revert and notify.
+ async function handleToggleToolset(toolset: ToolsetInfo, enabled: boolean) {
+ setToolsets(
+ current =>
+ current?.map(row => (row.name === toolset.name ? { ...row, enabled, available: enabled } : row)) ?? current
+ )
+
+ try {
+ await setToolsetEnabled(toolset.name, enabled, profile)
+ } catch (err) {
+ setToolsets(
+ current =>
+ current?.map(row => (row.name === toolset.name ? { ...row, enabled: !enabled, available: !enabled } : row)) ??
+ current
+ )
+ notifyError(err, t.skills.failedToUpdate(toolsetDisplayLabel(toolset)))
+ }
+ }
+
+ // 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: ToolsetInfo[], enabled: boolean) {
+ if (bulkBusy || targets.length === 0) {
+ return
+ }
+
+ setBulkBusy(true)
+
+ let done = 0
+
+ try {
+ for (const row of targets) {
+ await setToolsetEnabled(row.name, enabled, profile)
+ setToolsets(cur => cur?.map(r => (r.name === row.name ? { ...r, enabled, available: enabled } : r)) ?? cur)
+ done += 1
+ }
+
+ notify({ kind: 'success', title: t.skills.bulkUpdated(done), message: '' })
+ } catch (err) {
+ notifyError(err, t.skills.failedToUpdate(t.skills.tabToolsets))
+ } finally {
+ invalidateSlashCompletions()
+ setBulkBusy(false)
+ }
+ }
+
+ // One switch line covering enable-all/disable-all.
+ const bulkSwitch: ListStripMenuToggle = {
+ checked: bulkToolsets.length > 0 && bulkToolsets.every(ts => ts.enabled),
+ disabled: bulkBusy,
+ label: t.skills.all,
+ onToggle: checked => void bulkApply(bulkToolsets.filter(row => row.enabled !== checked), checked)
+ }
+
+ if (visibleToolsets.length === 0) {
+ return <CapabilityEmpty noun="tools" query={query} />
+ }
+
+ return (
+ <MasterDetail resizeId="capabilities-split" split="wide">
+ <ListColumn
+ header={
+ <ListStrip
+ left={<SortButton desc={toolsetsSortDesc} onFlip={() => $toolsetsSortDesc.set(!$toolsetsSortDesc.get())} />}
+ right={<ListStripMenu label={t.skills.tabToolsets} toggle={bulkSwitch} />}
+ />
+ }
+ >
+ {visibleToolsets.map(toolset => {
+ const label = toolsetDisplayLabel(toolset)
+ const calls = toolCalls ? toolsetCalls(toolset, toolCalls) : null
+
+ return (
+ <CapRow
+ active={activeToolset?.name === toolset.name}
+ busy={bulkBusy}
+ enabled={toolset.enabled}
+ key={toolset.name}
+ meta={
+ calls === null ? (
+ <CountSkeleton />
+ ) : calls > 0 ? (
+ `×${compactNumber(calls)}`
+ ) : (
+ `${toolNames(toolset).length} tools`
+ )
+ }
+ onSelect={() => setSelectedToolset(toolset.name)}
+ onToggle={checked => void handleToggleToolset(toolset, checked)}
+ subtitle={asText(toolset.description)}
+ title={label}
+ toggleLabel={t.skills.toggleToolset(label, !toolset.enabled)}
+ />
+ )
+ })}
+ </ListColumn>
+ <DetailColumn footer={t.skills.changesApplyNewSessions}>
+ {activeToolset && (
+ <ToolsetDetail
+ onConfiguredChange={refreshToolsets}
+ profile={profile}
+ toolCalls={toolCalls ?? {}}
+ toolset={activeToolset}
+ />
+ )}
+ </DetailColumn>
+ </MasterDetail>
+ )
+}
diff --git a/apps/desktop/src/app/chat/route-tile.tsx b/apps/desktop/src/app/chat/route-tile.tsx
index 4fee30c2d2d..5b75a87c17c 100644
--- a/apps/desktop/src/app/chat/route-tile.tsx
+++ b/apps/desktop/src/app/chat/route-tile.tsx
@@ -13,11 +13,11 @@ import { ContribBoundary, ContribRender } from '@/contrib/react/boundary'
import { useContributions } from '@/contrib/react/use-contributions'
import { $routeTiles, closeRouteTile, type RouteTile } from '@/store/route-tiles'
-import { $routesVersion, ARTIFACTS_ROUTE, contributedRoutes, MESSAGING_ROUTE, ROUTES_AREA, SKILLS_ROUTE } from '../routes'
+import { $routesVersion, ARTIFACTS_ROUTE, CAPABILITIES_ROUTE, contributedRoutes, MESSAGING_ROUTE, ROUTES_AREA } from '../routes'
import { paneMirror } from './pane-mirror'
-const SkillsView = lazy(async () => ({ default: (await import('../skills')).SkillsView }))
+const CapabilitiesView = lazy(async () => ({ default: (await import('../capabilities')).CapabilitiesView }))
const MessagingView = lazy(async () => ({ default: (await import('../messaging')).MessagingView }))
const ArtifactsView = lazy(async () => ({ default: (await import('../artifacts')).ArtifactsView }))
@@ -25,7 +25,7 @@ const ArtifactsView = lazy(async () => ({ default: (await import('../artifacts')
const BUILTIN_PAGES: Record<string, { render: () => ReactNode; title: string }> = {
[ARTIFACTS_ROUTE]: { render: () => <ArtifactsView />, title: 'Artifacts' },
[MESSAGING_ROUTE]: { render: () => <MessagingView />, title: 'Messaging' },
- [SKILLS_ROUTE]: { render: () => <SkillsView />, title: 'Capabilities' }
+ [CAPABILITIES_ROUTE]: { render: () => <CapabilitiesView />, title: 'Capabilities' }
}
/** Humanize a route path into a tab title: `/my-atlas` → `My Atlas`. */
diff --git a/apps/desktop/src/app/chat/sidebar/chat-sidebar.integration.test.tsx b/apps/desktop/src/app/chat/sidebar/chat-sidebar.integration.test.tsx
index d83e4221dff..b3d23686cc2 100644
--- a/apps/desktop/src/app/chat/sidebar/chat-sidebar.integration.test.tsx
+++ b/apps/desktop/src/app/chat/sidebar/chat-sidebar.integration.test.tsx
@@ -131,7 +131,7 @@ describe('ChatSidebar navigation activity', () => {
})
for (const [pathname, currentView, label] of [
- ['/skills', 'skills', 'Capabilities'],
+ ['/capabilities', 'capabilities', 'Capabilities'],
['/messaging', 'messaging', 'Messaging'],
['/artifacts', 'artifacts', 'Artifacts'],
['/cron', 'cron', 'Scheduled jobs']
diff --git a/apps/desktop/src/app/chat/sidebar/index.tsx b/apps/desktop/src/app/chat/sidebar/index.tsx
index 7ec0fc67ff2..3941007c4ea 100644
--- a/apps/desktop/src/app/chat/sidebar/index.tsx
+++ b/apps/desktop/src/app/chat/sidebar/index.tsx
@@ -137,11 +137,11 @@ import { $sidebarSessionRankIds } from '@/store/sidebar-sort'
import {
type AppView,
ARTIFACTS_ROUTE,
+ CAPABILITIES_ROUTE,
CRON_ROUTE,
MESSAGING_ROUTE,
SIDEBAR_NAV_AREA,
- type SidebarNavContribution,
- SKILLS_ROUTE
+ type SidebarNavContribution
} from '../../routes'
import type { SidebarNavItem } from '../../types'
import { type NewSessionSplitHandler, startNewSessionDrag } from '../new-session-drag'
@@ -207,11 +207,11 @@ const SIDEBAR_NAV: SidebarNavItem[] = [
keybindActionId: 'session.new'
},
{
- id: 'skills',
+ id: 'capabilities',
label: '',
icon: props => <Codicon name="symbol-misc" {...props} />,
- route: SKILLS_ROUTE,
- keybindActionId: 'nav.skills'
+ route: CAPABILITIES_ROUTE,
+ keybindActionId: 'nav.capabilities'
},
{
id: 'messaging',
@@ -1517,7 +1517,7 @@ export function ChatSidebar({
const isInteractive = Boolean(item.action) || Boolean(item.route)
const active =
- (item.id === 'skills' && currentView === 'skills') ||
+ (item.id === 'capabilities' && currentView === 'capabilities') ||
(item.id === 'messaging' && currentView === 'messaging') ||
(item.id === 'artifacts' && currentView === 'artifacts') ||
(item.id === 'cron' && currentView === 'cron') ||
diff --git a/apps/desktop/src/app/command-palette/index.tsx b/apps/desktop/src/app/command-palette/index.tsx
index 594c6ec1e1b..72b1729fc4e 100644
--- a/apps/desktop/src/app/command-palette/index.tsx
+++ b/apps/desktop/src/app/command-palette/index.tsx
@@ -93,6 +93,7 @@ import { openSession, openSessionIntentFromModifiers } from '../open-session'
import {
AGENTS_ROUTE,
ARTIFACTS_ROUTE,
+ CAPABILITIES_ROUTE,
COMMAND_CENTER_ROUTE,
CRON_ROUTE,
MESSAGING_ROUTE,
@@ -100,7 +101,6 @@ import {
NEW_CHAT_ROUTE,
PROFILES_ROUTE,
SETTINGS_ROUTE,
- SKILLS_ROUTE,
STARMAP_ROUTE
} from '../routes'
import { SECTIONS } from '../settings/constants'
@@ -812,12 +812,12 @@ function CommandPaletteBody({ onExited }: { onExited: () => void }) {
run: go(SETTINGS_ROUTE)
},
{
- action: 'nav.skills',
+ action: 'nav.capabilities',
icon: Wrench,
id: 'nav-skills',
keywords: ['skills', 'tools', 'toolsets', 'mcp', 'capabilities'],
- label: cc.nav.skills.title,
- run: go(SKILLS_ROUTE)
+ label: cc.nav.capabilities.title,
+ run: go(CAPABILITIES_ROUTE)
},
{
action: 'nav.messaging',
@@ -1077,7 +1077,7 @@ function CommandPaletteBody({ onExited }: { onExited: () => void }) {
// Deep-link straight to a Capabilities sub-tab. The root "Go to" entry only
// lands on the top-level Skills view; typing "mcp"/"tools"/"skills" should
// jump to the exact tab (matches the "not just the top lvl" ask).
- const capLabel = t.commandCenter.nav.skills.title
+ const capLabel = t.commandCenter.nav.capabilities.title
result.push({
heading: capLabel,
@@ -1087,28 +1087,28 @@ function CommandPaletteBody({ onExited }: { onExited: () => void }) {
id: 'cap-skills',
keywords: ['skills', 'capabilities'],
label: `${capLabel}: ${t.skills.tabSkills}`,
- run: go(`${SKILLS_ROUTE}?tab=skills`)
+ run: go(`${CAPABILITIES_ROUTE}?tab=skills`)
},
{
icon: SlidersHorizontal,
id: 'cap-toolsets',
keywords: ['tools', 'toolsets', 'capabilities'],
label: `${capLabel}: ${t.skills.tabToolsets}`,
- run: go(`${SKILLS_ROUTE}?tab=toolsets`)
+ run: go(`${CAPABILITIES_ROUTE}?tab=toolsets`)
},
{
icon: Layers3,
id: 'cap-mcp',
keywords: ['mcp', 'servers', 'tools', 'capabilities', 'model context protocol'],
label: `${capLabel}: ${t.skills.tabMcp}`,
- run: go(`${SKILLS_ROUTE}?tab=mcp`)
+ run: go(`${CAPABILITIES_ROUTE}?tab=mcp`)
},
{
icon: Package,
id: 'cap-plugins',
keywords: ['plugins', 'extensions', 'desktop plugins', 'agent plugins', 'catalog', 'addon', 'add-on'],
label: `${capLabel}: ${t.skills.tabPlugins}`,
- run: go(`${SKILLS_ROUTE}?tab=plugins`)
+ run: go(`${CAPABILITIES_ROUTE}?tab=plugins`)
}
]
})
@@ -1195,7 +1195,7 @@ function CommandPaletteBody({ onExited }: { onExited: () => void }) {
id: `sp-${entry.id}`,
keywords: [entry.context, entry.description ?? '', ...entry.keywords],
label: entry.label,
- run: go(`${SKILLS_ROUTE}?tab=plugins&plugin=${encodeURIComponent(entry.plugin)}`)
+ run: go(`${CAPABILITIES_ROUTE}?tab=plugins&plugin=${encodeURIComponent(entry.plugin)}`)
}))
})
}
@@ -1215,7 +1215,7 @@ function CommandPaletteBody({ onExited }: { onExited: () => void }) {
id: `mcp-${name}`,
keywords: ['mcp', 'server', 'tool'],
label: name,
- run: go(`${SKILLS_ROUTE}?tab=mcp&server=${encodeURIComponent(name)}`)
+ run: go(`${CAPABILITIES_ROUTE}?tab=mcp&server=${encodeURIComponent(name)}`)
}))
})
}
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 dca32b58a00..64d23961298 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
@@ -432,15 +432,15 @@ describe('useDesktopIntegrations', () => {
})
describe('route-scoped restoration', () => {
- it('restores a non-session route like /skills', () => {
- window.localStorage.setItem('hermes.desktop.lastRoute.profile.default', '/skills')
+ it('restores a non-session route like /capabilities', () => {
+ window.localStorage.setItem('hermes.desktop.lastRoute.profile.default', '/capabilities')
const sessions = [session({ id: 'some-session', profile: 'default' })]
render({ profileReady: true, sessions })
// /skills is not a session route — no ownership validation needed.
- expect(navigate).toHaveBeenCalledWith('/skills', { replace: true })
+ expect(navigate).toHaveBeenCalledWith('/capabilities', { replace: true })
})
it('does NOT restore overlay routes (settings/command-center)', () => {
diff --git a/apps/desktop/src/app/contrib/mcp-install-deeplink-dialog.tsx b/apps/desktop/src/app/contrib/mcp-install-deeplink-dialog.tsx
index a657c986879..2de39f013ca 100644
--- a/apps/desktop/src/app/contrib/mcp-install-deeplink-dialog.tsx
+++ b/apps/desktop/src/app/contrib/mcp-install-deeplink-dialog.tsx
@@ -117,7 +117,7 @@ export function McpInstallDeepLinkDialog() {
setHermesConfigCache(previous => (previous ? { ...previous, mcp_servers: nextServers } : previous))
notify({ kind: 'success', title: m.savedTitle, message: m.savedMessage(trimmedName) })
$mcpInstallRequest.set(null)
- navigate(`/skills?tab=mcp&server=${encodeURIComponent(trimmedName)}`)
+ navigate(`/capabilities?tab=mcp&server=${encodeURIComponent(trimmedName)}`)
} catch (err) {
setError(readableError(err, m.saveFailed).message)
} finally {
diff --git a/apps/desktop/src/app/contrib/panes.tsx b/apps/desktop/src/app/contrib/panes.tsx
index 1e972f1004d..bd2b86c5f30 100644
--- a/apps/desktop/src/app/contrib/panes.tsx
+++ b/apps/desktop/src/app/contrib/panes.tsx
@@ -146,7 +146,7 @@ export function useTitlebarToolContributions(side: 'left' | 'right'): TitlebarTo
}
/**
- * Bridge a page's `GroupSetter` extension point (SkillsView, MessagingView,
+ * Bridge a page's `GroupSetter` extension point (CapabilitiesView, MessagingView,
* ChatPreviewRail, …) into the registry: each call replaces the group's items
* as DATA contributions in `<prefix>.<side>`, so page-owned items flow through
* the same pipe plugins use. Setting an empty list clears the group.
diff --git a/apps/desktop/src/app/contrib/surfaces.app-routes.test.tsx b/apps/desktop/src/app/contrib/surfaces.app-routes.test.tsx
new file mode 100644
index 00000000000..dcd338cf4da
--- /dev/null
+++ b/apps/desktop/src/app/contrib/surfaces.app-routes.test.tsx
@@ -0,0 +1,55 @@
+import { cleanup, render, screen } from '@testing-library/react'
+import { atom } from 'nanostores'
+import { MemoryRouter } from 'react-router'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+
+import { APP_ROUTES, isOverlayView } from '../routes'
+
+import { ChatRoutesSurface } from './surfaces'
+import type { WiringActions } from './types'
+
+vi.mock('@/contrib/react/use-contributions', () => ({ useContributions: vi.fn() }))
+vi.mock('@/store/connections', () => ({ $activeConnectionId: atom('local') }))
+vi.mock('@/store/gateway', () => ({ $gateway: atom<unknown>(null) }))
+vi.mock('@/store/profile', () => ({ $activeGatewayProfile: atom('default') }))
+vi.mock('@/store/session', () => ({
+ $freshDraftReady: atom(false),
+ $gatewayState: atom('open')
+}))
+vi.mock('../chat', () => ({ ChatView: () => <div data-testid="chat-view" /> }))
+vi.mock('../capabilities', () => ({ CapabilitiesView: () => null }))
+vi.mock('../messaging', () => ({ MessagingView: () => null }))
+vi.mock('../artifacts', () => ({ ArtifactsView: () => null }))
+vi.mock('../chat/sidebar', () => ({ ChatSidebar: () => null }))
+vi.mock('../right-sidebar/terminal/chrome', () => ({ TerminalPaneChrome: () => null }))
+vi.mock('../shell/hooks/use-status-snapshot', () => ({ useStatusSnapshot: () => ({}) }))
+vi.mock('../shell/hooks/use-statusbar-items', () => ({
+ useStatusbarItems: () => ({ leftStatusbarItems: [], statusbarItems: [] })
+}))
+vi.mock('../shell/statusbar-controls', () => ({ StatusbarControls: () => null }))
+vi.mock('./latest-actions', () => ({ latestChatActions: () => ({}), latestSidebarActions: () => ({}) }))
+vi.mock('./panes', () => ({ setStatusbarItemGroup: vi.fn(), useStatusbarContributions: () => [] }))
+vi.mock('../shell/model-menu-panel', () => ({ ModelMenuPanel: () => null }))
+vi.mock('../shell/reasoning-menu-panel', () => ({ ReasoningMenuPanel: () => null }))
+
+afterEach(cleanup)
+
+// The route table (`APP_ROUTES`) and the `<Route>` list are kept by hand in two
+// files. A workspace page whose path is missing from the `<Route>` list matches
+// `:sessionId`, so the app opens a chat for a session named after the page.
+// Overlays are exempt: they are modal cards over whatever the shell shows.
+describe('ChatRoutesSurface and APP_ROUTES', () => {
+ const pages = APP_ROUTES.filter(route => route.view !== 'chat' && !isOverlayView(route.view))
+
+ it.each(pages.map(route => [route.path]))('%s has its own route and never opens as a session', path => {
+ const actions = { getGateway: () => null } as unknown as WiringActions
+
+ render(
+ <MemoryRouter initialEntries={[path]}>
+ <ChatRoutesSurface actions={actions} />
+ </MemoryRouter>
+ )
+
+ expect(screen.queryByTestId('chat-view')).toBeNull()
+ })
+})
diff --git a/apps/desktop/src/app/contrib/surfaces.tsx b/apps/desktop/src/app/contrib/surfaces.tsx
index 38fe681ba4d..83bf5559cc8 100644
--- a/apps/desktop/src/app/contrib/surfaces.tsx
+++ b/apps/desktop/src/app/contrib/surfaces.tsx
@@ -37,7 +37,7 @@ import type { SidebarActions, WiringActions } from './types'
// (agents/settings/…) are the controller's and stay in wiring.tsx.
const ArtifactsView = lazy(async () => ({ default: (await import('../artifacts')).ArtifactsView }))
const MessagingView = lazy(async () => ({ default: (await import('../messaging')).MessagingView }))
-const SkillsView = lazy(async () => ({ default: (await import('../skills')).SkillsView }))
+const CapabilitiesView = lazy(async () => ({ default: (await import('../capabilities')).CapabilitiesView }))
export function LegacySessionRedirect() {
const { sessionId } = useParams()
@@ -183,7 +183,7 @@ export const ChatRoutesSurface = memo(function ChatRoutesSurface({
<Routes>
<Route element={chatView} index />
<Route element={chatView} path=":sessionId" />
- <Route element={page(<SkillsView setStatusbarItemGroup={setStatusbarItemGroup} />)} path="skills" />
+ <Route element={page(<CapabilitiesView setStatusbarItemGroup={setStatusbarItemGroup} />)} path="capabilities" />
<Route element={page(<MessagingView setStatusbarItemGroup={setStatusbarItemGroup} />)} path="messaging" />
<Route element={page(<ArtifactsView setStatusbarItemGroup={setStatusbarItemGroup} />)} path="artifacts" />
<Route element={null} path="agents" />
diff --git a/apps/desktop/src/app/hooks/use-keybinds.ts b/apps/desktop/src/app/hooks/use-keybinds.ts
index a3ad1efdab3..8c84763cf9d 100644
--- a/apps/desktop/src/app/hooks/use-keybinds.ts
+++ b/apps/desktop/src/app/hooks/use-keybinds.ts
@@ -76,14 +76,14 @@ import {
$workspaceIsPage,
AGENTS_ROUTE,
ARTIFACTS_ROUTE,
+ CAPABILITIES_ROUTE,
CRON_ROUTE,
MESSAGING_ROUTE,
navigateToWorkspacePage,
NEW_CHAT_ROUTE,
PROFILES_ROUTE,
sessionRoute,
- SETTINGS_ROUTE,
- SKILLS_ROUTE
+ SETTINGS_ROUTE
} from '../routes'
export interface KeybindRuntimeDeps {
@@ -211,7 +211,7 @@ export function useKeybinds(deps: KeybindRuntimeDeps): void {
'nav.commandCenter': deps.toggleCommandCenter,
'nav.settings': () => navigate(SETTINGS_ROUTE),
'nav.profiles': () => navigate(PROFILES_ROUTE),
- 'nav.skills': () => navigateToWorkspacePage(navigate, SKILLS_ROUTE),
+ 'nav.capabilities': () => navigateToWorkspacePage(navigate, CAPABILITIES_ROUTE),
'nav.messaging': () => navigateToWorkspacePage(navigate, MESSAGING_ROUTE),
'nav.artifacts': () => navigateToWorkspacePage(navigate, ARTIFACTS_ROUTE),
'nav.cron': () => navigate(CRON_ROUTE),
diff --git a/apps/desktop/src/app/routes.titlebar-clusters.test.ts b/apps/desktop/src/app/routes.titlebar-clusters.test.ts
index b023d14448c..4e1c5c66fee 100644
--- a/apps/desktop/src/app/routes.titlebar-clusters.test.ts
+++ b/apps/desktop/src/app/routes.titlebar-clusters.test.ts
@@ -10,7 +10,7 @@ describe('hidesFixedTitlebarClusters', () => {
it('keeps clusters on chat and first-party workspace pages', () => {
expect(hidesFixedTitlebarClusters('chat')).toBe(false)
- expect(hidesFixedTitlebarClusters('skills')).toBe(false)
+ expect(hidesFixedTitlebarClusters('capabilities')).toBe(false)
expect(hidesFixedTitlebarClusters('messaging')).toBe(false)
expect(hidesFixedTitlebarClusters('artifacts')).toBe(false)
})
diff --git a/apps/desktop/src/app/routes.ts b/apps/desktop/src/app/routes.ts
index 98249354127..e9a9b4a9eab 100644
--- a/apps/desktop/src/app/routes.ts
+++ b/apps/desktop/src/app/routes.ts
@@ -12,7 +12,7 @@ export const NEW_CHAT_ROUTE = '/'
export const SETTINGS_ROUTE = '/settings'
export const COMMAND_CENTER_ROUTE = '/command-center'
export const SESSION_IMPORT_ROUTE = '/session-import'
-export const SKILLS_ROUTE = '/skills'
+export const CAPABILITIES_ROUTE = '/capabilities'
export const MESSAGING_ROUTE = '/messaging'
export const WEBHOOKS_ROUTE = '/webhooks'
export const ARTIFACTS_ROUTE = '/artifacts'
@@ -25,6 +25,7 @@ export type AppView =
| 'session-import'
| 'agents'
| 'artifacts'
+ | 'capabilities'
| 'chat'
| 'command-center'
| 'cron'
@@ -36,7 +37,6 @@ export type AppView =
| 'messaging'
| 'profiles'
| 'settings'
- | 'skills'
| 'starmap'
| 'webhooks'
@@ -44,13 +44,13 @@ export type AppRouteId =
| 'session-import'
| 'agents'
| 'artifacts'
+ | 'capabilities'
| 'command-center'
| 'cron'
| 'messaging'
| 'new'
| 'profiles'
| 'settings'
- | 'skills'
| 'starmap'
| 'webhooks'
@@ -65,7 +65,7 @@ export const APP_ROUTES = [
{ id: 'new', path: NEW_CHAT_ROUTE, view: 'chat' },
{ id: 'settings', path: SETTINGS_ROUTE, view: 'settings' },
{ id: 'command-center', path: COMMAND_CENTER_ROUTE, view: 'command-center' },
- { id: 'skills', path: SKILLS_ROUTE, view: 'skills' },
+ { id: 'capabilities', path: CAPABILITIES_ROUTE, view: 'capabilities' },
{ id: 'messaging', path: MESSAGING_ROUTE, view: 'messaging' },
{ id: 'webhooks', path: WEBHOOKS_ROUTE, view: 'webhooks' },
{ id: 'artifacts', path: ARTIFACTS_ROUTE, view: 'artifacts' },
@@ -158,14 +158,14 @@ export function isOverlayView(view: AppView): boolean {
* Contributed full pages (`extension`) hide the app clusters only while the
* page actually mounts `titleBar.*` chrome — those slots are mount-scoped, so
* a plugin page with no titlebar contribution keeps the app controls.
- * First-party workspace pages (skills/messaging/artifacts) keep the clusters. */
+ * First-party workspace pages (capabilities/messaging/artifacts) keep the clusters. */
export function hidesFixedTitlebarClusters(view: AppView): boolean {
return isOverlayView(view) || view === 'extension'
}
/** The pathname of a router target. Every classifier below reasons about a
- * PATH, but callers navigate to full targets (`/skills?tab=mcp`), and an
- * unstripped query reaches the session-id parser — `/skills?tab=mcp` reads as
+ * PATH, but callers navigate to full targets (`/capabilities?tab=mcp`), and an
+ * unstripped query reaches the session-id parser — `/capabilities?tab=mcp` reads as
* the session `skills?tab=mcp`, so Capabilities classifies as a chat.
* `sessionRoute` percent-encodes ids, so `?`/`#` can only start a query or a
* hash. */
@@ -282,7 +282,7 @@ export function syncWorkspaceRoute(pathname: string): void {
* Navigate to `to`, fronting the workspace pane when it is a page route.
*
* `syncWorkspaceRoute` covers route CHANGES; this covers the RE-CLICK, the one
- * case it can't see — hitting Capabilities while already on `/skills` with a
+ * case it can't see — hitting Capabilities while already on `/capabilities` with a
* tile focused leaves the location untouched, so no effect fires and only an
* imperative reveal brings the page back. Use it wherever a nav affordance can
* be triggered from the page it targets.
diff --git a/apps/desktop/src/app/routes.workspace-reveal.test.ts b/apps/desktop/src/app/routes.workspace-reveal.test.ts
index 3af32126802..c7039223dce 100644
--- a/apps/desktop/src/app/routes.workspace-reveal.test.ts
+++ b/apps/desktop/src/app/routes.workspace-reveal.test.ts
@@ -19,6 +19,7 @@ import {
AGENTS_ROUTE,
appViewForPath,
ARTIFACTS_ROUTE,
+ CAPABILITIES_ROUTE,
CRON_ROUTE,
MESSAGING_ROUTE,
navigateToWorkspacePage,
@@ -28,7 +29,6 @@ import {
routeSessionId,
sessionRoute,
SETTINGS_ROUTE,
- SKILLS_ROUTE,
syncWorkspaceRoute
} from './routes'
@@ -68,9 +68,9 @@ afterEach(() => {
describe('routePathname', () => {
it('keeps a bare path and drops a query or hash', () => {
- expect(routePathname(SKILLS_ROUTE)).toBe('/skills')
- expect(routePathname('/skills?tab=mcp')).toBe('/skills')
- expect(routePathname('/skills?tab=mcp&server=ctx7')).toBe('/skills')
+ expect(routePathname(CAPABILITIES_ROUTE)).toBe('/capabilities')
+ expect(routePathname('/capabilities?tab=mcp')).toBe('/capabilities')
+ expect(routePathname('/capabilities?tab=mcp&server=ctx7')).toBe('/capabilities')
expect(routePathname('/settings#keys')).toBe('/settings')
})
@@ -87,9 +87,9 @@ describe('classification of targets carrying a query', () => {
// servers), and Settings redirects old /settings?tab=mcp deep links to the
// last one. Unstripped, they parsed as SESSION ids and read as 'chat'.
it.each([
- [`${SKILLS_ROUTE}?tab=skills`, 'skills'],
- [`${SKILLS_ROUTE}?tab=toolsets`, 'skills'],
- [`${SKILLS_ROUTE}?tab=mcp&server=ctx7`, 'skills'],
+ [`${CAPABILITIES_ROUTE}?tab=skills`, 'capabilities'],
+ [`${CAPABILITIES_ROUTE}?tab=toolsets`, 'capabilities'],
+ [`${CAPABILITIES_ROUTE}?tab=mcp&server=ctx7`, 'capabilities'],
[`${SETTINGS_ROUTE}?tab=keys`, 'settings']
])('%s is not a session route', (to, view) => {
expect(routeSessionId(to)).toBeNull()
@@ -99,14 +99,14 @@ describe('classification of targets carrying a query', () => {
describe('syncWorkspaceRoute', () => {
it('publishes and fronts on a page route', () => {
- syncWorkspaceRoute(SKILLS_ROUTE)
+ syncWorkspaceRoute(CAPABILITIES_ROUTE)
expect($workspaceIsPage.get()).toBe(true)
expect(fronted()).toBe(true)
})
it('fronts on a page route reached with a query', () => {
- syncWorkspaceRoute(`${SKILLS_ROUTE}?tab=mcp`)
+ syncWorkspaceRoute(`${CAPABILITIES_ROUTE}?tab=mcp`)
expect($workspaceIsPage.get()).toBe(true)
expect(fronted()).toBe(true)
@@ -155,13 +155,13 @@ describe('navigateToWorkspacePage', () => {
it('navigates and fronts, so a re-click on the page you are already on still shows it', () => {
const navigate = vi.fn()
- navigateToWorkspacePage(navigate, SKILLS_ROUTE)
+ navigateToWorkspacePage(navigate, CAPABILITIES_ROUTE)
- expect(navigate).toHaveBeenCalledWith(SKILLS_ROUTE, undefined)
+ expect(navigate).toHaveBeenCalledWith(CAPABILITIES_ROUTE, undefined)
expect(fronted()).toBe(true)
})
- it.each([`${SKILLS_ROUTE}?tab=skills`, `${SKILLS_ROUTE}?tab=toolsets`, `${SKILLS_ROUTE}?tab=mcp&server=ctx7`])(
+ it.each([`${CAPABILITIES_ROUTE}?tab=skills`, `${CAPABILITIES_ROUTE}?tab=toolsets`, `${CAPABILITIES_ROUTE}?tab=mcp&server=ctx7`])(
'fronts for the palette target %s',
to => {
navigateToWorkspacePage(vi.fn(), to)
diff --git a/apps/desktop/src/app/session/hooks/use-route-resume.ts b/apps/desktop/src/app/session/hooks/use-route-resume.ts
index 631f10e0072..90c6c6cab59 100644
--- a/apps/desktop/src/app/session/hooks/use-route-resume.ts
+++ b/apps/desktop/src/app/session/hooks/use-route-resume.ts
@@ -62,7 +62,7 @@ function rawHashLooksLikeSession(): boolean {
return (
!hash.startsWith('/settings') &&
- !hash.startsWith('/skills') &&
+ !hash.startsWith('/capabilities') &&
!hash.startsWith('/messaging') &&
!hash.startsWith('/artifacts')
)
diff --git a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
index 8036fedfb7e..eba90a0b298 100644
--- a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
+++ b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx
@@ -4799,10 +4799,10 @@ describe('selectSidebarItem', () => {
await waitFor(() => expect(handle).not.toBeNull())
act(() => {
- handle!.selectSidebarItem({ icon: (() => null) as never, id: 'skills', label: 'Capabilities', route: '/skills' })
+ handle!.selectSidebarItem({ icon: (() => null) as never, id: 'skills', label: 'Capabilities', route: '/capabilities' })
})
- expect(navigate).toHaveBeenCalledWith('/skills', undefined)
+ expect(navigate).toHaveBeenCalledWith('/capabilities', undefined)
expect(noteActiveTreeGroup).toHaveBeenCalledWith(null)
expect(revealTreePane).toHaveBeenCalledWith('workspace')
})
diff --git a/apps/desktop/src/app/settings/moved-tabs.test.ts b/apps/desktop/src/app/settings/moved-tabs.test.ts
index 8f2c7ee6c26..0c7c6911c7c 100644
--- a/apps/desktop/src/app/settings/moved-tabs.test.ts
+++ b/apps/desktop/src/app/settings/moved-tabs.test.ts
@@ -4,11 +4,11 @@ import { movedSettingsTabRedirect } from './moved-tabs'
describe('movedSettingsTabRedirect', () => {
it('sends the retired Settings plugin/MCP tabs to Capabilities, keeping the row selector', () => {
- expect(movedSettingsTabRedirect('?tab=plugins')).toBe('/skills?tab=plugins')
+ expect(movedSettingsTabRedirect('?tab=plugins')).toBe('/capabilities?tab=plugins')
expect(movedSettingsTabRedirect('?tab=plugins&plugin=demo%2Fplugin')).toBe(
- '/skills?tab=plugins&plugin=demo%2Fplugin'
+ '/capabilities?tab=plugins&plugin=demo%2Fplugin'
)
- expect(movedSettingsTabRedirect('?tab=mcp&server=github')).toBe('/skills?tab=mcp&server=github')
+ expect(movedSettingsTabRedirect('?tab=mcp&server=github')).toBe('/capabilities?tab=mcp&server=github')
})
it('leaves live Settings tabs alone', () => {
diff --git a/apps/desktop/src/app/settings/moved-tabs.ts b/apps/desktop/src/app/settings/moved-tabs.ts
index f9ba7b6cf2e..a0a3f9d3dfa 100644
--- a/apps/desktop/src/app/settings/moved-tabs.ts
+++ b/apps/desktop/src/app/settings/moved-tabs.ts
@@ -1,4 +1,4 @@
-import { SKILLS_ROUTE } from '../routes'
+import { CAPABILITIES_ROUTE } from '../routes'
// Settings tabs that now live in Capabilities → the row-selector param each
// carries (`?server=` for MCP, `?plugin=` for Plugins). Old bookmarks and
@@ -19,5 +19,5 @@ export function movedSettingsTabRedirect(search: string): null | string {
const row = params.get(rowParam)
const suffix = row ? `&${rowParam}=${encodeURIComponent(row)}` : ''
- return `${SKILLS_ROUTE}?tab=${tab}${suffix}`
+ return `${CAPABILITIES_ROUTE}?tab=${tab}${suffix}`
}
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 187d0b3574e..e2c1a59cdc0 100644
--- a/apps/desktop/src/app/settings/plugin-install-modal.test.tsx
+++ b/apps/desktop/src/app/settings/plugin-install-modal.test.tsx
@@ -27,7 +27,7 @@ import {
import { $activeGatewayProfile } from '@/store/profile'
import { $connection, $gatewayState } from '@/store/session'
-import { PluginsTab } from '../skills/plugins-tab'
+import { PluginsTab } from '../capabilities/plugins/plugins-tab'
import { PluginInstallModal } from './plugin-install-modal'
@@ -36,7 +36,7 @@ const installDesktopPlugin = vi.fn()
const renderFlow = () =>
render(
- <MemoryRouter initialEntries={['/skills?tab=plugins']}>
+ <MemoryRouter initialEntries={['/capabilities?tab=plugins']}>
<QueryClientProvider client={queryClient}>
<PluginsTab profile={null} />
<PluginInstallModal />
diff --git a/apps/desktop/src/app/settings/plugin-install-modal.tsx b/apps/desktop/src/app/settings/plugin-install-modal.tsx
index 0dfb390e189..ea111cdc79c 100644
--- a/apps/desktop/src/app/settings/plugin-install-modal.tsx
+++ b/apps/desktop/src/app/settings/plugin-install-modal.tsx
@@ -291,7 +291,7 @@ export function PluginInstallModal() {
closePluginInstallRequest()
// Catalog picks come from Capabilities → Plugins; land back there.
- navigate(request.catalogName ? '/skills?tab=plugins' : '/settings?tab=plugins')
+ navigate(request.catalogName ? '/capabilities?tab=plugins' : '/settings?tab=plugins')
return
}
diff --git a/apps/desktop/src/app/settings/use-settings-search.ts b/apps/desktop/src/app/settings/use-settings-search.ts
index 99db78e05b3..56a07a565e4 100644
--- a/apps/desktop/src/app/settings/use-settings-search.ts
+++ b/apps/desktop/src/app/settings/use-settings-search.ts
@@ -21,7 +21,7 @@ import {
type SettingsSearchEntry
} from './settings-search'
-/** An installed plugin row, deep-linkable as `/skills?tab=plugins&plugin=<id>`. */
+/** An installed plugin row, deep-linkable as `/capabilities?tab=plugins&plugin=<id>`. */
export interface PluginSearchEntry {
context: string
description?: string
diff --git a/apps/desktop/src/app/shell/group-setter.ts b/apps/desktop/src/app/shell/group-setter.ts
index b0f212f15e3..0e48ce5012e 100644
--- a/apps/desktop/src/app/shell/group-setter.ts
+++ b/apps/desktop/src/app/shell/group-setter.ts
@@ -1,4 +1,4 @@
-// The `GroupSetter` shape pages take as an extension-point prop (SkillsView,
+// The `GroupSetter` shape pages take as an extension-point prop (CapabilitiesView,
// MessagingView, ChatPreviewRail, …). The live implementation is the
// registry-backed `registryGroupSetter` in app/contrib/panes.tsx.
type Side = 'left' | 'right'
diff --git a/apps/desktop/src/app/shell/titlebar-controls.test.tsx b/apps/desktop/src/app/shell/titlebar-controls.test.tsx
index a656013946c..1d3c1257836 100644
--- a/apps/desktop/src/app/shell/titlebar-controls.test.tsx
+++ b/apps/desktop/src/app/shell/titlebar-controls.test.tsx
@@ -86,7 +86,7 @@ describe('TitlebarControls fixed clusters', () => {
})
it('keeps the app clusters on a first-party workspace page', () => {
- renderControls('/skills')
+ renderControls('/capabilities')
expect(windowControls()).not.toBeNull()
expect(appControls()).not.toBeNull()
diff --git a/apps/desktop/src/app/skills/index.tsx b/apps/desktop/src/app/skills/index.tsx
deleted file mode 100644
index 4a57291c58e..00000000000
--- a/apps/desktop/src/app/skills/index.tsx
+++ /dev/null
@@ -1,1406 +0,0 @@
-import { compactNumber } from '@hermes/shared'
-import { useStore } from '@nanostores/react'
-import { useQuery } from '@tanstack/react-query'
-import type * as React from 'react'
-import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
-import { useNavigate } from 'react-router'
-
-import { ArchiveSkillConfirmDialog } from '@/app/learning/archive-skill-confirm-dialog'
-import { CodeEditor } from '@/components/chat/code-editor'
-import { PageLoader } from '@/components/page-loader'
-import { Badge } from '@/components/ui/badge'
-import { Button } from '@/components/ui/button'
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
-import { CountSkeleton } from '@/components/ui/skeleton'
-import type { DesktopRosterAgent } from '@/global'
-import {
- editLearningNode,
- getLearningNode,
- getOfficialSkills,
- getProfiles,
- getSkillContent,
- getSkills,
- getToolsets,
- getUsageAnalytics,
- previewSkillHub,
- type ProfileScope,
- profileScopeKey,
- setSkillEnabled,
- setToolsetEnabled
-} from '@/hermes'
-import { useI18n } from '@/i18n'
-import { isDesktopToolsetVisible } from '@/lib/desktop-toolsets'
-import { Loader2 } from '@/lib/icons'
-import { queryClient } from '@/lib/query-client'
-import { invalidateSlashCompletions } from '@/lib/slash-completion-cache'
-import { normalize } from '@/lib/text'
-import { useStoreSelector } from '@/lib/use-session-slice'
-import { cn } from '@/lib/utils'
-import { $gateway, activeGatewayConnectionId } from '@/store/gateway'
-import { $hubActions, installHubSkill, notifyHubActionFailed, OFFICIAL_SKILLS_KEY } from '@/store/hub-actions'
-import { notify, notifyError } from '@/store/notifications'
-import { $activeGatewayProfile, normalizeProfileKey } from '@/store/profile'
-import type { OfficialSkillInfo, SkillInfo, ToolsetInfo } from '@/types/hermes'
-
-import { useOnProfileSwitch } from '../hooks/use-on-profile-switch'
-import { useRefreshHotkey } from '../hooks/use-refresh-hotkey'
-import { useRouteEnumParam } from '../hooks/use-route-enum-param'
-import {
- CapRow,
- DetailColumn,
- DetailPane,
- ListColumn,
- ListStrip,
- ListStripButton,
- ListStripMenu,
- type ListStripMenuToggle,
- MasterDetail,
- ToolChip
-} from '../master-detail'
-import { PanelEmpty, PanelPill } from '../overlays/panel'
-import { PageSearchShell } from '../page-search-shell'
-import { SETTINGS_ROUTE } from '../routes'
-import { BrowserRealProfilePanel } from '../settings/browser-real-profile-panel'
-import { ComputerUsePanel } from '../settings/computer-use-panel'
-import { asText, includesQuery, prettyName, toolNames, toolsetDisplayLabel } from '../settings/helpers'
-import { TerminalBackendPanel } from '../settings/terminal-backend-panel'
-import { ToolsetConfigPanel } from '../settings/toolset-config-panel'
-import type { SetStatusbarItemGroup } from '../shell/statusbar-controls'
-
-import { EmbeddedHubPicker } from './embedded-hub-picker'
-import { McpTab } from './mcp-tab'
-import { PluginsTab } from './plugins-tab'
-import { $skillsSortDesc, $toolsetsSortDesc } from './store'
-
-// 'hub' is gone as a top-level tab — the Skills Hub browser lives inside the
-// Skills tab now (EmbeddedHubPicker below the installed list). Legacy
-// `?tab=hub` links fall back to 'skills' via useRouteEnumParam.
-const SKILLS_MODES = ['skills', 'toolsets', 'mcp', 'plugins'] as const
-
-// Skills + toolsets live in the RQ cache so switching tabs/pages paints the
-// cached lists instantly (no reload flash) and mount only fires a deduped
-// background refetch. A profile swap globally invalidates (see store/profile),
-// so these plain keys refetch against the new backend automatically.
-// Both are extended with the Capabilities scope key at the call sites so every
-// scoped profile keeps its own cached copy (prefix invalidations still match).
-const SKILLS_QUERY_KEY = ['skills-list'] as const
-const TOOLSETS_QUERY_KEY = ['toolsets-list'] as const
-
-// Per-tool call counts come from a 365-day message scan — heavy, and purely
-// cosmetic (Toolsets usage badges). Cache the result module-wide with a TTL so
-// bouncing between tabs/pages doesn't re-run the scan every time. Keyed by
-// the Capabilities scope profile: analytics are profile-scoped, so a scope or
-// app-profile switch must not show the previous profile's counts.
-// `useRefreshHotkey` still forces a fresh pull.
-const TOOL_CALLS_TTL_MS = 10 * 60 * 1000
-const toolCallsCache = new Map<string, { at: number; value: Record<string, number> }>()
-
-async function loadToolCalls(
- scopeKey: string,
- scopeProfile: ProfileScope,
- force = false
-): Promise<Record<string, number>> {
- const cached = toolCallsCache.get(scopeKey)
-
- if (!force && cached && Date.now() - cached.at < TOOL_CALLS_TTL_MS) {
- return cached.value
- }
-
- const analytics = await getUsageAnalytics(365, scopeProfile)
-
- const value = Object.fromEntries((analytics.tools ?? []).map(e => [e.tool, e.count]))
-
- toolCallsCache.set(scopeKey, { at: Date.now(), value })
-
- return value
-}
-
-const usageOf = (skill: SkillInfo): number => (typeof skill.usage === 'number' ? skill.usage : 0)
-
-const categoryFor = (skill: SkillInfo): string => asText(skill.category) || 'general'
-
-// Row subtitle: category, with non-default origins badged.
-function skillSubtitle(skill: SkillInfo): React.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>
- )}
- </>
- )
-}
-
-function filteredSkills(skills: SkillInfo[], query: string, desc: boolean): SkillInfo[] {
- const q = normalize(query)
- const sign = desc ? 1 : -1
-
- return skills
- .filter(
- skill =>
- !q || includesQuery(skill.name, q) || includesQuery(skill.description, q) || includesQuery(skill.category, q)
- )
- .sort((a, b) => sign * (usageOf(b) - usageOf(a)) || asText(a.name).localeCompare(asText(b.name)))
-}
-
-// Catalog rows have no usage yet — plain A–Z, same query fields as installed
-// rows plus tags (the catalog's frontmatter tags are its richest search text).
-function filteredOfficial(skills: OfficialSkillInfo[], query: string): OfficialSkillInfo[] {
- const q = normalize(query)
-
- return skills
- .filter(
- skill =>
- !q ||
- includesQuery(skill.name, q) ||
- includesQuery(skill.description, q) ||
- includesQuery(skill.category, q) ||
- skill.tags.some(tag => includesQuery(tag, q))
- )
- .sort((a, b) => asText(a.name).localeCompare(asText(b.name)))
-}
-
-const toolsetCalls = (toolset: ToolsetInfo, toolCalls: Record<string, number>): number =>
- toolNames(toolset).reduce((sum, name) => sum + (toolCalls[name] ?? 0), 0)
-
-function filteredToolsets(
- toolsets: ToolsetInfo[],
- query: string,
- toolCalls: Record<string, number>,
- desc: boolean
-): ToolsetInfo[] {
- const q = normalize(query)
- const sign = desc ? 1 : -1
-
- return toolsets
- .filter(toolset => {
- if (!isDesktopToolsetVisible(toolset.name)) {
- return false
- }
-
- if (!q) {
- return true
- }
-
- return (
- includesQuery(toolset.name, q) ||
- includesQuery(toolsetDisplayLabel(toolset), q) ||
- includesQuery(toolset.description, q) ||
- toolNames(toolset).some(name => includesQuery(name, q))
- )
- })
- .sort(
- (a, b) =>
- sign * (toolsetCalls(b, toolCalls) - toolsetCalls(a, toolCalls)) ||
- toolsetDisplayLabel(a).localeCompare(toolsetDisplayLabel(b))
- )
-}
-
-const visibleToolsetCount = (toolsets: ToolsetInfo[]) => toolsets.filter(ts => isDesktopToolsetVisible(ts.name)).length
-
-interface SkillsViewProps extends React.ComponentProps<'section'> {
- setStatusbarItemGroup?: SetStatusbarItemGroup
- /** Embedded mode (plugin dialogs — e.g. Bot Mode's Advanced section): tab
- * state lives in local React state instead of the route's `?tab=` param,
- * so an embedding dialog never fights the page router. */
- embedded?: boolean
- /** Pin the WHOLE view to one profile: the scope selector is hidden and
- * every tab reads/writes THAT profile. This is the plugin door — Bot Mode
- * renders the real Capabilities surface pinned to a bot. */
- fixedProfile?: string
- /** Pin the view to a REGISTERED gateway connection alongside `fixedProfile`:
- * every read/write routes to that machine's backend instead of the active
- * gateway. `''`/`'local'` mean the local pool. This is Bot Mode's
- * remote-target door — a bot living on another registered gateway gets the
- * live surface pointed at ITS backend. Ignored without `fixedProfile`. */
- fixedConnection?: string
-}
-
-export function SkillsView({
- embedded = false,
- fixedConnection,
- fixedProfile,
- setStatusbarItemGroup: _setStatusbarItemGroup,
- ...props
-}: SkillsViewProps) {
- const { t } = useI18n()
- // Both hooks run unconditionally (rules of hooks); embedded picks the local
- // one so tab clicks inside a dialog don't rewrite the page URL.
- const routeTab = useRouteEnumParam('tab', SKILLS_MODES, 'skills')
- const localTab = useState<(typeof SKILLS_MODES)[number]>('skills')
- const [mode, setMode] = embedded ? localTab : routeTab
- // $gateway only feeds the MCP tab — gate the subscription so Skills/Toolsets
- // tabs don't re-render on connect/disconnect/reconnect.
- const gateway = useStoreSelector($gateway, g => (mode === 'mcp' ? g : null))
-
- const [query, setQuery] = useState('')
-
- // The hub picker hosts a full docs-site iframe — the single most expensive
- // thing on this page. It mounts lazily (first time the Skills tab is shown)
- // and then STAYS mounted but hidden across tab switches, so bouncing to
- // Tools/MCP and back never reloads the site. Derived-state pattern: flips
- // once, during render, never back.
- const [hubMounted, setHubMounted] = useState(mode === 'skills')
-
- if (mode === 'skills' && !hubMounted) {
- setHubMounted(true)
- }
-
- // Capabilities scope selector: which profile's Skills/Tools/MCP config we're
- // editing — and on WHICH gateway. A profile belongs to one gateway, so on a
- // multi-connection desktop the selector offers every (connection, profile)
- // pair from the union agent roster and an explicit pick routes every
- // read/write to that machine's backend. Defaults to the app-wide active
- // profile (unchanged behavior). A `fixedProfile` (+ optional
- // `fixedConnection`) pins the scope outright (selector hidden).
- const activeProfile = useStore($activeGatewayProfile)
- const [scopeOverride, setScopeOverride] = useState<null | string | { connectionId: string; profile: string }>(null)
-
- const scopeProfile: ProfileScope = useMemo(
- () =>
- fixedProfile
- ? fixedConnection
- ? { connectionId: fixedConnection, profile: fixedProfile }
- : fixedProfile
- : (scopeOverride ?? activeProfile ?? null),
- [activeProfile, fixedConnection, fixedProfile, scopeOverride]
- )
-
- const scopeKey = profileScopeKey(scopeProfile)
-
- // The registry connection an explicit override pins — null for the ambient
- // active-profile path and for fixed-profile pins without a connection.
- const scopeConnectionId =
- scopeProfile && typeof scopeProfile === 'object' ? (scopeProfile.connectionId ?? '').trim() || 'local' : null
-
- // Scoped to a DIFFERENT backend than the window's active gateway? The MCP
- // tab's live-reload RPC rides the active gateway socket, which would reload
- // the wrong machine — withhold it for cross-backend scopes.
- const crossBackendScope = scopeConnectionId !== null && scopeConnectionId !== (activeGatewayConnectionId() ?? 'local')
-
- const { data: profilesData } = useQuery({
- queryKey: ['capabilities-profiles'],
- queryFn: () => getProfiles(),
- staleTime: 60_000,
- // Pinned scope never shows the selector, so don't fetch the roster for it.
- enabled: !fixedProfile
- })
-
- const profiles = profilesData?.profiles ?? []
-
- // v2 multi-connection registry: cheap local IPC to learn whether more than
- // one gateway is registered. Only then is the (heavier) union agent roster
- // fetched to feed the selector — single-connection setups keep the exact
- // legacy profiles list. Both feature-detected for older Electron mains.
- const registryBridge = window.hermesDesktop?.connections
- const rosterBridge = window.hermesDesktop?.getAgentRoster
-
- const { data: registryData } = useQuery({
- queryKey: ['capabilities-connections-registry'],
- queryFn: () => registryBridge!.list(),
- staleTime: 60_000,
- enabled: !fixedProfile && Boolean(registryBridge) && Boolean(rosterBridge)
- })
-
- const multiConnection = (registryData?.connections.length ?? 0) > 1
-
- const { data: rosterData } = useQuery({
- queryKey: ['capabilities-agent-roster'],
- queryFn: () => rosterBridge!(),
- staleTime: 60_000,
- enabled: !fixedProfile && multiConnection
- })
-
- const {
- data: skills,
- isError: skillsFailed,
- error: skillsError
- } = useQuery({
- queryKey: [...SKILLS_QUERY_KEY, scopeKey],
- queryFn: () => getSkills(scopeProfile),
- staleTime: 0
- })
-
- const { data: toolsets, isError: toolsetsFailed } = useQuery({
- queryKey: [...TOOLSETS_QUERY_KEY, scopeKey],
- queryFn: () => getToolsets(scopeProfile),
- staleTime: 0
- })
-
- // The built-in optional-skills catalog (optional-skills/ shipped with the
- // repo) — rendered under the installed list with install buttons. Local
- // checkout scan on the backend, so it's cheap; failures (older backend
- // without the endpoint) just render no catalog rows.
- const { data: officialData } = useQuery({
- queryKey: [...OFFICIAL_SKILLS_KEY, scopeKey],
- queryFn: () => getOfficialSkills(scopeProfile),
- staleTime: 60_000,
- retry: false
- })
-
- // Optimistic write-through against the scoped Skills key: toggles/bulk/
- // archive repaint instantly; the next background refetch reconciles.
- const setSkills = useCallback(
- (fn: (cur: SkillInfo[] | undefined) => SkillInfo[] | undefined) =>
- queryClient.setQueryData<SkillInfo[]>([...SKILLS_QUERY_KEY, scopeKey], prev => fn(prev) ?? prev),
- [scopeKey]
- )
-
- // tool name -> call count over the analytics window. null = still loading
- // (badges show skeletons); {} = loaded empty / unavailable backend.
- const [toolCalls, setToolCalls] = useState<Record<string, number> | null>(null)
- // Bumped on profile switch so a slow analytics load from profile A can't set
- // toolCalls after the user moved to B.
- const toolCallsEpoch = useRef(0)
- const skillsSortDesc = useStore($skillsSortDesc)
- const toolsetsSortDesc = useStore($toolsetsSortDesc)
- const [bulkBusy, setBulkBusy] = useState(false)
- const [selectedSkill, setSelectedSkill] = useState<string | null>(null)
- // Catalog selection is separate from installed-skill selection: identifiers
- // (official/<category>/<name>) vs names. Non-null wins the detail pane.
- const [selectedOfficial, setSelectedOfficial] = useState<string | null>(null)
- const [selectedToolset, setSelectedToolset] = useState<string | null>(null)
-
- const refreshCapabilities = useCallback(async () => {
- await Promise.all([
- queryClient.invalidateQueries({ queryKey: SKILLS_QUERY_KEY }),
- queryClient.invalidateQueries({ queryKey: TOOLSETS_QUERY_KEY }),
- queryClient.invalidateQueries({ queryKey: OFFICIAL_SKILLS_KEY })
- ])
-
- invalidateSlashCompletions()
-
- // An explicit refresh is the one time we bypass the analytics TTL — but
- // only if the badges are already on screen; otherwise let the lazy load
- // pick it up when Toolsets is first shown. Guard the async set against a
- // profile/scope switch landing before it resolves.
- if (toolCallsCache.size > 0) {
- const epoch = toolCallsEpoch.current
-
- loadToolCalls(scopeKey, scopeProfile, true)
- .then(value => toolCallsEpoch.current === epoch && setToolCalls(value))
- .catch(() => toolCallsEpoch.current === epoch && setToolCalls({}))
- }
- }, [scopeKey, scopeProfile])
-
- const refreshToolsets = useCallback(() => {
- void queryClient.invalidateQueries({ queryKey: TOOLSETS_QUERY_KEY })
- }, [])
-
- useRefreshHotkey(refreshCapabilities)
-
- // Per-tool call counts feed ONLY the Toolsets tab's usage badges/sort, and
- // the query behind them is a 365-day message scan — heavy. Fetch it lazily
- // the first time Toolsets is shown, never on Skills or MCP, so it can't
- // starve the MCP tab's config load. Absent → toolsets sort A–Z until it lands.
- useEffect(() => {
- if (mode !== 'toolsets' || toolCalls !== null) {
- return
- }
-
- let cancelled = false
- // Guard the setter by epoch too: when toolCalls is already null at switch
- // time, setToolCalls(null) is a no-op so this effect never re-runs to flip
- // `cancelled` — the epoch check catches that gap.
- const epoch = toolCallsEpoch.current
- const live = () => !cancelled && toolCallsEpoch.current === epoch
-
- loadToolCalls(scopeKey, scopeProfile)
- .then(value => live() && setToolCalls(value))
- .catch(() => live() && setToolCalls({}))
-
- return () => void (cancelled = true)
- }, [mode, scopeKey, scopeProfile, toolCalls])
-
- // On an app-wide profile switch the analytics cache is scope-keyed, but our
- // local toolCalls state isn't — leaving it non-null would keep the lazy
- // effect from ever re-running, so badges/sort would show the previous
- // profile's counts. Reset to null so the next Toolsets view reloads for the
- // active profile. The switch also drops any scope override — the user just
- // changed what "here" means, and a stale override pointing at the previous
- // selection would be surprising.
- useOnProfileSwitch(() => {
- toolCallsEpoch.current += 1
- setToolCalls(null)
- setScopeOverride(null)
- setSelectedOfficial(null)
- })
-
- const visibleSkills = useMemo(
- () => (skills ? filteredSkills(skills, query, skillsSortDesc) : []),
- [query, skills, skillsSortDesc]
- )
-
- // Installed-name set for the hub picker's already-installed guard — the
- // UNFILTERED list on purpose (search must not make a skill look absent).
- const installedSkillNames = useMemo(() => new Set((skills ?? []).map(s => s.name)), [skills])
-
- // Catalog rows still available to install: drop entries whose lock says
- // installed AND entries whose name already appears in the installed list
- // (covers installs from before the lock existed, or by hand).
- const visibleOfficial = useMemo(() => {
- const catalog = (officialData?.skills ?? []).filter(s => !s.installed && !installedSkillNames.has(s.name))
-
- return filteredOfficial(catalog, query)
- }, [installedSkillNames, officialData, query])
-
- // Identifiers with a hub install currently running — selected as a joined
- // string so $hubActions' per-log-line churn doesn't re-render the list.
- const runningInstallKey = useStoreSelector($hubActions, actions =>
- Object.keys(actions)
- .filter(key => actions[key]?.running)
- .sort()
- .join('|')
- )
-
- const runningInstalls = useMemo(() => new Set(runningInstallKey.split('|').filter(Boolean)), [runningInstallKey])
-
- const visibleToolsets = useMemo(
- () => (toolsets ? filteredToolsets(toolsets, query, toolCalls ?? {}, toolsetsSortDesc) : []),
- [query, toolCalls, toolsets, toolsetsSortDesc]
- )
-
- // 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 bulkSkills = skills ?? []
- const bulkToolsets = useMemo(() => (toolsets ?? []).filter(ts => isDesktopToolsetVisible(ts.name)), [toolsets])
-
- // Rotating placeholder nudges from the user's own data — teach that search
- // understands categories and tool names, not just titles.
- const searchHints = useMemo(() => {
- if (mode === 'skills' && skills?.length) {
- const counts = new Map<string, number>()
-
- for (const skill of skills) {
- const key = categoryFor(skill)
- counts.set(key, (counts.get(key) || 0) + 1)
- }
-
- return [...counts.entries()]
- .sort(([, a], [, b]) => b - a)
- .slice(0, 5)
- .map(([category]) => t.common.tryHint(category.toLowerCase()))
- }
-
- if (mode === 'toolsets' && toolsets?.length) {
- return toolsets
- .filter(ts => isDesktopToolsetVisible(ts.name) && toolNames(ts).length > 0)
- .slice(0, 5)
- .map(ts => t.common.tryHint(toolNames(ts)[0]))
- }
-
- return undefined
- }, [mode, skills, toolsets, t])
-
- // 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]
- )
-
- // A selected catalog row wins the detail pane; it clears when filtered out
- // (or when its install finishes and the row leaves the catalog list).
- const activeOfficial = useMemo(
- () => visibleOfficial.find(s => s.identifier === selectedOfficial) ?? null,
- [selectedOfficial, visibleOfficial]
- )
-
- const activeToolset = useMemo(
- () => visibleToolsets.find(ts => ts.name === selectedToolset) ?? visibleToolsets[0] ?? null,
- [selectedToolset, visibleToolsets]
- )
-
- // Single toggles are optimistic and silent on success (the row repaints
- // immediately — a toast per flip would spam rapid customization). Errors
- // revert and notify.
- 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, scopeProfile)
- // 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))
- }
- }
-
- // Catalog install: routes through the standard hub action pipeline
- // (background action + tailed log + query invalidation), same as the
- // embedded hub picker — the row's button spins off ITS $hubActions entry
- // and the finished install refetches both lists, flipping the row from the
- // catalog section into the installed section with the normal toggle.
- function handleInstallOfficial(skill: OfficialSkillInfo) {
- notify({ kind: 'success', title: t.skills.hub.installStarted(skill.name), message: t.skills.hub.actionLog })
- void installHubSkill(skill.identifier, scopeProfile).catch(err =>
- notifyHubActionFailed(err, t.skills.hub.actionFailed, skill.name, scopeProfile)
- )
- }
-
- async function handleToggleToolset(toolset: ToolsetInfo, enabled: boolean) {
- const scopedToolsetKey = [...TOOLSETS_QUERY_KEY, scopeKey]
-
- const writeScoped = (fn: (cur: ToolsetInfo[] | undefined) => ToolsetInfo[] | undefined) =>
- queryClient.setQueryData<ToolsetInfo[]>(scopedToolsetKey, prev => fn(prev) ?? prev)
-
- writeScoped(
- current =>
- current?.map(row => (row.name === toolset.name ? { ...row, enabled, available: enabled } : row)) ?? current
- )
-
- try {
- await setToolsetEnabled(toolset.name, enabled, scopeProfile)
- } catch (err) {
- writeScoped(
- current =>
- current?.map(row => (row.name === toolset.name ? { ...row, enabled: !enabled, available: !enabled } : row)) ??
- current
- )
- notifyError(err, t.skills.failedToUpdate(toolsetDisplayLabel(toolset)))
- }
- }
-
- // 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(skillTargets: SkillInfo[], toolsetTargets: ToolsetInfo[], enabled: boolean) {
- if (bulkBusy || skillTargets.length + toolsetTargets.length === 0) {
- return
- }
-
- setBulkBusy(true)
-
- let done = 0
-
- try {
- for (const row of skillTargets) {
- await setSkillEnabled(row.name, enabled, scopeProfile)
- setSkills(cur => cur?.map(r => (r.name === row.name ? { ...r, enabled } : r)) ?? cur)
- done += 1
- }
-
- for (const row of toolsetTargets) {
- await setToolsetEnabled(row.name, enabled, scopeProfile)
- queryClient.setQueryData<ToolsetInfo[]>(
- [...TOOLSETS_QUERY_KEY, scopeKey],
- cur => cur?.map(r => (r.name === row.name ? { ...r, enabled, available: enabled } : r)) ?? cur
- )
- done += 1
- }
-
- notify({ kind: 'success', title: t.skills.bulkUpdated(done), message: '' })
- } catch (err) {
- notifyError(err, t.skills.failedToUpdate(mode === 'skills' ? t.skills.tabSkills : t.skills.tabToolsets))
- } finally {
- invalidateSlashCompletions()
- setBulkBusy(false)
- }
- }
-
- const bulkToggle = (enabled: boolean) =>
- mode === 'skills'
- ? bulkApply(
- bulkSkills.filter(row => row.enabled !== enabled),
- [],
- enabled
- )
- : bulkApply(
- [],
- bulkToolsets.filter(row => row.enabled !== enabled),
- enabled
- )
-
- // "Never used" = zero recorded activity. The pruning move for a 100+ skill
- // install: keep the workhorses, shed the noise.
- const disableUnused = () =>
- bulkApply(
- bulkSkills.filter(skill => skill.enabled && usageOf(skill) === 0),
- [],
- false
- )
-
- // One switch line covering enable-all/disable-all.
- const bulkSwitch = (allEnabled: boolean): ListStripMenuToggle => ({
- checked: allEnabled,
- disabled: bulkBusy,
- label: t.skills.all,
- onToggle: checked => void bulkToggle(checked)
- })
-
- const allSkillsEnabled = bulkSkills.length > 0 && bulkSkills.every(s => s.enabled)
- const allToolsetsEnabled = bulkToolsets.length > 0 && bulkToolsets.every(ts => ts.enabled)
-
- const sortButton = (desc: boolean, flip: () => void) => (
- <ListStripButton onClick={flip}>{desc ? t.skills.sortMostUsedDesc : t.skills.sortLeastUsedAsc}</ListStripButton>
- )
-
- // Full-bleed empty state, matching the MCP tab (spans both columns, not a
- // cramped note in the left rail). Query-aware, and says "tools" not the
- // internal "toolsets".
- const capabilityEmpty = (noun: string) => {
- const q = query.trim()
-
- return (
- <div className="flex h-full min-h-0 flex-1">
- <PanelEmpty
- description={q ? t.skills.emptyNothingMatches(q) : t.skills.emptyNoneAvailable(noun)}
- icon="search"
- title={t.skills.emptyNoneFound(noun)}
- />
- </div>
- )
- }
-
- // 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)
- // Bumped on profile switch so an in-flight openSkillEditor fetch from profile
- // A can't reopen the editor with A's content after switching to B.
- const skillEditorEpoch = useRef(0)
-
- // A profile switch swaps the backend under the open editor/archive dialog —
- // their targets belong to profile A, so a save/archive would hit B. Drop them
- // so nothing edits or archives against the newly active profile.
- useOnProfileSwitch(() => {
- skillEditorEpoch.current += 1
- setSkillEditor(null)
- setSkillDraft('')
- setArchiveTarget(null)
- })
-
- const openSkillEditor = async (name: string) => {
- const epoch = skillEditorEpoch.current
-
- try {
- const node = await getLearningNode(name, scopeProfile)
-
- if (skillEditorEpoch.current !== epoch) {
- return
- }
-
- setSkillEditor({ content: node.content, name })
- setSkillDraft(node.content)
- } catch (err) {
- notifyError(err, name)
- }
- }
-
- const saveSkillEdit = async () => {
- if (!skillEditor) {
- return
- }
-
- setSkillSaving(true)
-
- try {
- await editLearningNode(skillEditor.name, skillDraft, scopeProfile)
- notify({
- kind: 'success',
- title: t.skills.skillUpdated,
- message: t.skills.appliesToNewSessions(skillEditor.name)
- })
- setSkillEditor(null)
- void refreshCapabilities()
- } catch (err) {
- notifyError(err, skillEditor.name)
- } finally {
- setSkillSaving(false)
- }
- }
-
- 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>
- )
-
- // Selecting a different scope is the same staleness hazard as an app-wide
- // profile switch: in-flight analytics belong to the previous scope's cache
- // key, and an open skill editor / archive dialog targets the PREVIOUS
- // scope's skill (a save/archive would hit the new one). Reset both here —
- // this handler is the only way the scope changes besides an app profile
- // switch, which useOnProfileSwitch already covers.
- //
- // Selector option values are `connectionId::profile` on multi-connection
- // desktops (the roster path) and bare profile names otherwise, so one
- // handler decodes both.
- const changeScope = (value: string) => {
- const sep = value.indexOf('::')
-
- // Roster picks (`connectionId::profile`) stay objects — a `local::` pick
- // must PIN the local pool even while a remote gateway is active. Legacy
- // bare-name picks stay strings so cache keys and routing are unchanged.
- const next: ProfileScope = sep >= 0 ? { connectionId: value.slice(0, sep), profile: value.slice(sep + 2) } : value
-
- if (profileScopeKey(next) === scopeKey) {
- return
- }
-
- setScopeOverride(next as string | { connectionId: string; profile: string })
- toolCallsEpoch.current += 1
- setToolCalls(null)
- skillEditorEpoch.current += 1
- setSkillEditor(null)
- setSkillDraft('')
- setArchiveTarget(null)
- setSelectedOfficial(null)
- }
-
- // Scope-selector rows. Multi-connection desktops list every reachable
- // (connection, profile) agent from the union roster — the selected profile
- // is configured ON ITS OWN GATEWAY. Otherwise the legacy per-profile list.
- const scopeOptions: { key: string; label: string; value: string }[] = useMemo(() => {
- if (multiConnection && rosterData?.agents?.length) {
- const activeId = activeGatewayConnectionId() ?? 'local'
-
- return rosterData.agents.map((agent: DesktopRosterAgent) => ({
- key: `${agent.connectionId}::${agent.profile}`,
- label:
- agent.connectionId === activeId
- ? `${agent.profile} — ${agent.connectionLabel} (current)`
- : `${agent.profile} — ${agent.connectionLabel}`,
- value: `${agent.connectionId}::${agent.profile}`
- }))
- }
-
- return (profilesData?.profiles ?? []).map(p => ({
- key: p.name,
- label: p.is_default ? 'Hermes (default)' : p.name,
- value: p.name
- }))
- }, [multiConnection, profilesData, rosterData])
-
- // The selector's current value must match one option's value exactly. On the
- // roster path an ambient (non-override) scope is the active gateway's
- // profile, which lives at `activeConnectionId::profile`.
- const scopeSelectValue = useMemo(() => {
- if (scopeProfile && typeof scopeProfile === 'object') {
- return `${(scopeProfile.connectionId ?? '').trim() || 'local'}::${scopeProfile.profile ?? ''}`
- }
-
- if (multiConnection && rosterData?.agents?.length) {
- return `${activeGatewayConnectionId() ?? 'local'}::${normalizeProfileKey(scopeProfile)}`
- }
-
- return scopeProfile ?? ''
- }, [multiConnection, rosterData, scopeProfile])
-
- // Scope selector, shown above EVERY Capabilities tab (Skills, Tools, MCP,
- // Browse Hub). Lets the user configure ANY profile's capabilities — on any
- // registered gateway — without switching the whole app. Only meaningful
- // with >1 option; hidden otherwise to avoid clutter.
- // Plugins embeds the selector in its Agent-column header (compact, no label,
- // no border): desktop halves on that page are app-level and must not read as
- // governed by "Configuring: <profile>".
- const compactSelector = mode === 'plugins'
- const scopeLabel = scopeOptions.find(option => option.value === scopeSelectValue)?.label
-
- const profileScopeSelector =
- scopeOptions.length > 1 ? (
- <div
- className={cn(
- 'flex min-w-0 items-center gap-2',
- compactSelector ? 'flex-1' : 'border-b border-(--ui-stroke-secondary) px-3 py-2'
- )}
- >
- {!compactSelector && (
- <span className="text-[0.7rem] font-medium text-(--ui-text-tertiary)">{t.skills.configuringProfile}</span>
- )}
- <Select onValueChange={changeScope} value={scopeSelectValue}>
- <SelectTrigger className={cn('text-xs', compactSelector ? 'h-6 w-full max-w-64 px-2' : 'h-7 w-56')}>
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {scopeOptions.map(option => (
- <SelectItem key={option.key} value={option.value}>
- {option.label}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </div>
- ) : null
-
- return (
- <PageSearchShell
- {...props}
- activeTab={mode}
- onSearchChange={setQuery}
- onTabChange={id => setMode(id as (typeof SKILLS_MODES)[number])}
- // MCP manages a handful of entries with the editor right there —
- // searching it is noise.
- searchHidden={mode === 'mcp' || mode === 'plugins'}
- searchHints={searchHints}
- searchPlaceholder={mode === 'skills' ? t.skills.searchSkills : t.skills.searchToolsets}
- searchValue={query}
- tabs={[
- { id: 'skills', label: t.skills.tabSkills, meta: skills?.length ?? null },
- { id: 'toolsets', label: t.skills.tabToolsets, meta: toolsets ? visibleToolsetCount(toolsets) : null },
- { id: 'mcp', label: t.skills.tabMcp },
- { id: 'plugins', label: t.skills.tabPlugins }
- ]}
- >
- {/* One shared column: the scope selector sits above whichever tab is
- active, so Skills / Tools / MCP all read and write the SAME selected
- profile. */}
- <div className="flex h-full flex-col">
- {/* Plugins renders the selector INSIDE its agent section: desktop
- plugins on that page belong to the app, not to any profile, and
- must not sit under a "Configuring: <profile>" header. */}
- {mode !== 'plugins' && profileScopeSelector}
- <div className="flex min-h-0 flex-1 flex-col">
- <div className={mode === 'skills' ? 'min-h-40 flex-1 overflow-hidden' : 'min-h-0 flex-1'}>
- {mode === 'plugins' ? (
- // Agent plugins for the scoped profile (selector in the section
- // header), app-level desktop plugins, the live catalog picker
- // underneath. Keyed on scope so a profile/connection switch
- // reloads the agent list.
- <PluginsTab
- key={`plugins-${scopeKey}`}
- profile={scopeProfile}
- scopeLabel={scopeLabel}
- scopeSelector={profileScopeSelector}
- />
- ) : mode === 'mcp' ? (
- // The gateway instance backs ONLY the live `reload.mcp` RPC, and
- // it is the ACTIVE gateway's socket — for a scope pinned to a
- // different backend that RPC would hot-reload the wrong
- // machine's MCP servers, so it is withheld (config edits still
- // apply on that backend's next session).
- <McpTab gateway={crossBackendScope ? null : gateway} key={`mcp-${scopeKey}`} profile={scopeProfile} />
- ) : (skillsFailed || toolsetsFailed) && (!skills || !toolsets) ? (
- <PanelEmpty
- action={
- <Button onClick={() => void refreshCapabilities()} size="sm">
- {t.skills.refresh}
- </Button>
- }
- description={skillsError instanceof Error ? skillsError.message : undefined}
- icon="error"
- title={t.skills.skillsLoadFailed}
- />
- ) : !skills || !toolsets ? (
- <PageLoader label={t.skills.loading} />
- ) : mode === 'skills' ? (
- // Installed skills on top, the Skills Hub browser underneath —
- // discovery sits with management. The list region keeps a floor
- // (min-h-40, on the wrapper above) so a tall hub viewport or a
- // short window shrinks the HUB, never the list: the sort strip
- // and "changes apply" footer can no longer be starved to 0px
- // and painted over by the hub header.
- visibleSkills.length === 0 && visibleOfficial.length === 0 ? (
- capabilityEmpty('skills')
- ) : (
- <MasterDetail pane={skillEditorPane} resizeId="capabilities-split" split="wide">
- <ListColumn
- header={
- <ListStrip
- left={sortButton(skillsSortDesc, () => $skillsSortDesc.set(!$skillsSortDesc.get()))}
- right={
- <ListStripMenu
- items={[
- {
- disabled: bulkBusy,
- label: t.skills.disableUnused,
- onSelect: () => void disableUnused()
- }
- ]}
- label={t.skills.tabSkills}
- toggle={bulkSwitch(allSkillsEnabled)}
- />
- }
- />
- }
- >
- {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}
- />
- ))}
- {/* The built-in optional-skills catalog, below the
- installed list: every official skill Hermes ships but
- hasn't installed yet, with a one-click install that
- flips the row into the installed section above. */}
- {visibleOfficial.length > 0 && (
- <div className="flex h-7 shrink-0 items-end px-2 pb-1 text-[0.62rem] font-medium uppercase tracking-wide text-(--ui-text-quaternary)">
- {t.skills.officialCatalog}
- </div>
- )}
- {visibleOfficial.map(skill => {
- const installing = runningInstalls.has(skill.identifier)
-
- return (
- <CapRow
- action={
- <Button
- disabled={installing}
- onClick={() => handleInstallOfficial(skill)}
- size="xs"
- variant="text"
- >
- {installing && <Loader2 className="size-3 animate-spin" />}
- {installing ? t.skills.hub.installing : t.skills.hub.install}
- </Button>
- }
- active={activeOfficial?.identifier === skill.identifier}
- enabled={false}
- key={skill.identifier}
- onSelect={() => setSelectedOfficial(skill.identifier)}
- subtitle={prettyName(skill.category)}
- title={skill.name}
- />
- )
- })}
- </ListColumn>
- <DetailColumn footer={t.skills.changesApplyNewSessions}>
- {activeOfficial ? (
- <OfficialSkillDetail
- installing={runningInstalls.has(activeOfficial.identifier)}
- onInstall={() => handleInstallOfficial(activeOfficial)}
- profile={scopeProfile}
- skill={activeOfficial}
- />
- ) : (
- activeSkill && (
- <SkillDetail
- onArchive={() => setArchiveTarget(activeSkill.name)}
- onEdit={() => void openSkillEditor(activeSkill.name)}
- profile={scopeProfile}
- skill={activeSkill}
- />
- )
- )}
- </DetailColumn>
- </MasterDetail>
- )
- ) : visibleToolsets.length === 0 ? (
- capabilityEmpty('tools')
- ) : (
- <MasterDetail resizeId="capabilities-split" split="wide">
- <ListColumn
- header={
- <ListStrip
- left={sortButton(toolsetsSortDesc, () => $toolsetsSortDesc.set(!$toolsetsSortDesc.get()))}
- right={<ListStripMenu label={t.skills.tabToolsets} toggle={bulkSwitch(allToolsetsEnabled)} />}
- />
- }
- >
- {visibleToolsets.map(toolset => {
- const label = toolsetDisplayLabel(toolset)
- const calls = toolCalls ? toolsetCalls(toolset, toolCalls) : null
-
- return (
- <CapRow
- active={activeToolset?.name === toolset.name}
- busy={bulkBusy}
- enabled={toolset.enabled}
- key={toolset.name}
- meta={
- calls === null ? (
- <CountSkeleton />
- ) : calls > 0 ? (
- `×${compactNumber(calls)}`
- ) : (
- `${toolNames(toolset).length} tools`
- )
- }
- onSelect={() => setSelectedToolset(toolset.name)}
- onToggle={checked => void handleToggleToolset(toolset, checked)}
- subtitle={asText(toolset.description)}
- title={label}
- toggleLabel={t.skills.toggleToolset(label, !toolset.enabled)}
- />
- )
- })}
- </ListColumn>
- <DetailColumn footer={t.skills.changesApplyNewSessions}>
- {activeToolset && (
- <ToolsetDetail
- onConfiguredChange={refreshToolsets}
- profile={scopeProfile}
- toolCalls={toolCalls ?? {}}
- toolset={activeToolset}
- />
- )}
- </DetailColumn>
- </MasterDetail>
- )}
- </div>
- {/* Hub picker OUTSIDE the tab ternary: it lazy-mounts the first time
- Skills is shown, then stays mounted (hidden) across Tools/MCP so
- the docs-site iframe never reloads on a tab bounce. No scope key
- on purpose — the picker fetches nothing; scope rides the
- `profile` prop into each install call, and remounting on scope
- change would reload the whole site for no data benefit. */}
- {hubMounted && (
- <EmbeddedHubPicker hidden={mode !== 'skills'} installedNames={installedSkillNames} profile={scopeProfile} />
- )}
- </div>
- </div>
- {archiveTarget && (
- <ArchiveSkillConfirmDialog
- onApply={() => {
- const name = archiveTarget
- const snapshot = skills
-
- setSkills(current => current?.filter(skill => skill.name !== name) ?? current)
- invalidateSlashCompletions()
-
- if (skillEditor?.name === name) {
- setSkillEditor(null)
- }
-
- return () => setSkills(() => snapshot)
- }}
- onClose={() => setArchiveTarget(null)}
- onFailure={(err, name) => notifyError(err, name)}
- open
- profile={scopeProfile}
- skillId={archiveTarget}
- skillName={archiveTarget}
- />
- )}
- </PageSearchShell>
- )
-}
-
-// Feature-detection flag for plugins (Bot Mode): TRUE means this build's
-// SkillsView routes `fixedConnection` to the pinned connection's backend.
-// Older builds export SkillsView WITHOUT the prop — passing it there would
-// silently read/write the ACTIVE gateway under the remote bot's profile name,
-// which is exactly the wrong-machine bug the prop exists to prevent. A static
-// property is probe-able without rendering.
-SkillsView.supportsFixedConnection = true as const
-
-// Shared inspector header — mirrors Messaging's PlatformDetail so Skills and
-// Tools share one title/description block and tab switches don't jump.
-function DetailHeader({
- description,
- pills,
- title
-}: {
- description: React.ReactNode
- pills?: React.ReactNode
- title: string
-}) {
- return (
- <header>
- <div className="flex min-h-6 flex-wrap items-center gap-2">
- <h3 className="min-w-0 truncate text-[0.9375rem] font-semibold tracking-tight">{title}</h3>
- {pills}
- </div>
- <p className="mt-1 text-[length:var(--conversation-caption-font-size)] leading-(--conversation-caption-line-height) text-(--ui-text-tertiary)">
- {description}
- </p>
- </header>
- )
-}
-
-// Frontmatter parse for display: the YAML block between the leading `---`
-// fences, flattened to top-level `key: value` rows (nested blocks render as
-// their raw indented text). Display-only — never fed back to the backend.
-function parseFrontmatter(content: string): { body: string; meta: [string, string][] } {
- const match = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(content)
-
- if (!match) {
- return { body: content, meta: [] }
- }
-
- const meta: [string, string][] = []
- let currentKey: null | string = null
- let block: string[] = []
-
- const flush = () => {
- if (currentKey !== null) {
- meta.push([currentKey, block.join('\n').trim()])
- }
-
- currentKey = null
- block = []
- }
-
- for (const line of match[1].split(/\r?\n/)) {
- const kv = /^(\w[\w-]*):\s?(.*)$/.exec(line)
-
- if (kv) {
- flush()
- currentKey = kv[1]
- block = kv[2] ? [kv[2]] : []
- } else if (currentKey !== null) {
- block.push(line.replace(/^ {2}/, ''))
- }
- }
-
- flush()
-
- return { body: content.slice(match[0].length), meta }
-}
-
-function SkillDetail({
- onArchive,
- onEdit,
- profile,
- skill
-}: {
- onArchive: () => void
- onEdit: () => void
- profile?: ProfileScope
- skill: SkillInfo
-}) {
- const { t } = useI18n()
- // Only learned/local skills are the user's to rewrite or archive — bundled
- // and hub skills are managed by their sources.
- const editable = skill.provenance === 'agent'
-
- // The FULL skill — frontmatter metadata + complete SKILL.md body — for any
- // provenance, scoped to the Capabilities profile selector. The row list only
- // carries name/description; the pane shows the whole thing.
- const contentQuery = useQuery({
- queryKey: ['skill-content', skill.name, profileScopeKey(profile)],
- queryFn: () => getSkillContent(skill.name, profile),
- staleTime: 60_000
- })
-
- const parsed = useMemo(
- () => (contentQuery.data ? parseFrontmatter(contentQuery.data.content) : null),
- [contentQuery.data]
- )
-
- return (
- <>
- <DetailHeader
- description={asText(skill.description) || t.skills.noDescription}
- pills={
- <>
- <PanelPill>{prettyName(categoryFor(skill))}</PanelPill>
- {skill.provenance && skill.provenance !== 'bundled' && (
- <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">
- {t.skills.edit}
- </Button>
- <Button className="text-destructive hover:text-destructive" onClick={onArchive} size="xs" variant="text">
- {t.skills.archive}
- </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 ? (
- <CountSkeleton />
- ) : parsed ? (
- <pre
- className="overflow-auto whitespace-pre-wrap wrap-break-word rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) p-3 font-mono text-[0.68rem] leading-relaxed"
- data-selectable-text="true"
- >
- {parsed.body.trim() || t.skills.noDescription}
- </pre>
- ) : null}
- </>
- )
-}
-
-// Detail pane for a not-yet-installed catalog skill: metadata + full SKILL.md
-// via the hub preview endpoint (same resolver an install uses), plus the same
-// install button as the row.
-function OfficialSkillDetail({
- installing,
- onInstall,
- profile,
- skill
-}: {
- installing: boolean
- onInstall: () => void
- profile?: ProfileScope
- skill: OfficialSkillInfo
-}) {
- const { t } = useI18n()
-
- const previewQuery = useQuery({
- queryKey: ['official-skill-preview', skill.identifier, profileScopeKey(profile)],
- queryFn: () => previewSkillHub(skill.identifier, profile),
- staleTime: 5 * 60_000,
- retry: false
- })
-
- const parsed = useMemo(
- () => (previewQuery.data?.skill_md ? parseFrontmatter(previewQuery.data.skill_md) : null),
- [previewQuery.data]
- )
-
- return (
- <>
- <DetailHeader
- description={asText(skill.description) || t.skills.noDescription}
- pills={
- <>
- <PanelPill>{prettyName(skill.category)}</PanelPill>
- <PanelPill tone="muted">{t.skills.officialPill}</PanelPill>
- </>
- }
- title={skill.name}
- />
- <div className="flex items-center gap-2">
- <Button disabled={installing} onClick={onInstall} size="xs" variant="textStrong">
- {installing && <Loader2 className="size-3 animate-spin" />}
- {installing ? t.skills.hub.installing : t.skills.hub.install}
- </Button>
- </div>
- {parsed && parsed.meta.length > 0 && (
- <div className="grid gap-1 rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) p-3">
- {parsed.meta.map(([key, value]) => (
- <div className="flex gap-2 text-[0.68rem] leading-4" key={key}>
- <span className="w-24 shrink-0 font-medium text-(--ui-text-tertiary)">{key}</span>
- <span className="min-w-0 whitespace-pre-wrap break-words text-(--ui-text-secondary)">{value}</span>
- </div>
- ))}
- </div>
- )}
- {previewQuery.isLoading ? (
- <CountSkeleton />
- ) : parsed ? (
- <pre
- className="overflow-auto whitespace-pre-wrap wrap-break-word rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) p-3 font-mono text-[0.68rem] leading-relaxed"
- data-selectable-text="true"
- >
- {parsed.body.trim() || t.skills.noDescription}
- </pre>
- ) : null}
- </>
- )
-}
-
-function ToolsetDetail({
- toolset,
- toolCalls,
- onConfiguredChange,
- profile
-}: {
- toolset: ToolsetInfo
- toolCalls: Record<string, number>
- onConfiguredChange: () => void
- profile?: ProfileScope
-}) {
- const { t } = useI18n()
- const navigate = useNavigate()
- const tools = toolNames(toolset)
- const label = toolsetDisplayLabel(toolset)
-
- return (
- <>
- {/* "Configured" as a resting state is noise — only the warn state earns a pill. */}
- <DetailHeader
- description={asText(toolset.description) || t.skills.noDescription}
- pills={!toolset.configured && <PanelPill tone="warn">{t.skills.needsKeys}</PanelPill>}
- title={label}
- />
- {tools.length > 0 && (
- <div className="flex flex-wrap gap-1">
- {tools.map(name => (
- <ToolChip key={name}>
- {name}
- {(toolCalls[name] ?? 0) > 0 && (
- <span className="ml-1 text-(--ui-text-quaternary)">×{compactNumber(toolCalls[name])}</span>
- )}
- </ToolChip>
- ))}
- </div>
- )}
- {toolset.name === 'vision' && (
- // Vision has no provider matrix — model resolution runs through the
- // auxiliary model config. Point at the actual home (Settings → Models,
- // aux "vision" row) via an internal deep link instead of leaving the
- // detail pane empty.
- <div className="grid gap-1.5">
- <p className="text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
- {t.skills.visionModelHint}
- </p>
- <div>
- <Button
- onClick={() => navigate(`${SETTINGS_ROUTE}?tab=config:model&aux=vision`)}
- size="xs"
- variant="textStrong"
- >
- {t.skills.visionModelLink}
- </Button>
- </div>
- </div>
- )}
- {toolset.name === 'computer_use' && <ComputerUsePanel onConfiguredChange={onConfiguredChange} />}
- {/* Real-profile consent toggle ABOVE the backend/provider matrix — the
- config option users kept missing because its only GUI home was the
- generic Settings → Config editor. */}
- {toolset.name === 'browser' && <BrowserRealProfilePanel profile={profile} />}
- {toolset.name === 'terminal' && <TerminalBackendPanel onConfiguredChange={onConfiguredChange} />}
- <ToolsetConfigPanel
- key={`${toolset.name}:${profileScopeKey(profile)}`}
- onConfiguredChange={onConfiguredChange}
- profile={profile}
- toolset={toolset.name}
- />
- </>
- )
-}
diff --git a/apps/desktop/src/app/skills/store.ts b/apps/desktop/src/app/skills/store.ts
deleted file mode 100644
index 2105a5d45b7..00000000000
--- a/apps/desktop/src/app/skills/store.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { Codecs, persistentAtom } from '@/lib/persisted'
-
-// Per-view sort direction for the Capabilities lists — persisted so each tab
-// remembers most/least-used across navigations and restarts.
-export const $skillsSortDesc = persistentAtom('hermes.desktop.capabilities.skillsSortDesc', true, Codecs.bool)
-export const $toolsetsSortDesc = persistentAtom('hermes.desktop.capabilities.toolsetsSortDesc', true, Codecs.bool)
diff --git a/apps/desktop/src/app/types.ts b/apps/desktop/src/app/types.ts
index 1236178bfc5..1c4efe0acaf 100644
--- a/apps/desktop/src/app/types.ts
+++ b/apps/desktop/src/app/types.ts
@@ -122,7 +122,14 @@ export interface HandoffFailResponse {
state?: string
}
-export type SidebarNavId = 'artifacts' | 'command-center' | 'cron' | 'messaging' | 'new-session' | 'settings' | 'skills'
+export type SidebarNavId =
+ | 'artifacts'
+ | 'capabilities'
+ | 'command-center'
+ | 'cron'
+ | 'messaging'
+ | 'new-session'
+ | 'settings'
export interface SidebarNavItem {
/** Built-in view id, or a contributed row's namespaced contribution id. */
diff --git a/apps/desktop/src/components/pane-shell/tree/focused-session-tab.test.ts b/apps/desktop/src/components/pane-shell/tree/focused-session-tab.test.ts
index 4dddfeaaf77..c75b893f665 100644
--- a/apps/desktop/src/components/pane-shell/tree/focused-session-tab.test.ts
+++ b/apps/desktop/src/components/pane-shell/tree/focused-session-tab.test.ts
@@ -89,7 +89,7 @@ describe('focused chat zone drives the tab verbs', () => {
const model = await import('@/components/pane-shell/tree/model')
const { registry } = await import('@/contrib/registry')
- for (const id of ['workspace', 'preview-tile:url:x', 'route-tile:/skills']) {
+ for (const id of ['workspace', 'preview-tile:url:x', 'route-tile:/capabilities']) {
registry.register({
area: 'panes',
data: id === 'workspace' ? { placement: 'main', uncloseable: true } : { placement: 'main' },
@@ -105,15 +105,15 @@ describe('focused chat zone drives the tab verbs', () => {
tree.declareDefaultTree(
model.split('row', [
model.group(['workspace'], { active: 'workspace', id: 'grp-main' }),
- model.group(['preview-tile:url:x', 'route-tile:/skills'], { active: 'preview-tile:url:x', id: 'grp-view' })
+ model.group(['preview-tile:url:x', 'route-tile:/capabilities'], { active: 'preview-tile:url:x', id: 'grp-view' })
])
)
tree.noteActiveTreeGroup('grp-view')
// ⌃Tab cycles within the preview zone, not main's.
- expect(tree.cycleTreeTabInFocusedZone(1)).toBe('route-tile:/skills')
+ expect(tree.cycleTreeTabInFocusedZone(1)).toBe('route-tile:/capabilities')
expect(tree.$layoutTree.get() && model.findGroup(tree.$layoutTree.get()!, 'grp-view')?.active).toBe(
- 'route-tile:/skills'
+ 'route-tile:/capabilities'
)
// ⌘W closes the zone's active tab through its registered closer.
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index bb826de0c80..417790d62c3 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -283,7 +283,7 @@ export const ar = defineLocale({
'nav.commandCenter': 'فتح مركز الأوامر',
'nav.settings': 'فتح الإعدادات',
'nav.profiles': 'فتح الملفات الشخصية',
- 'nav.skills': 'فتح المهارات',
+ 'nav.capabilities': 'فتح المهارات',
'nav.messaging': 'فتح المراسلة',
'nav.artifacts': 'فتح العناصر',
'nav.cron': 'فتح المهام المجدولة',
@@ -1318,7 +1318,7 @@ export const ar = defineLocale({
title: 'الإعدادات',
detail: 'تكوين Hermes desktop'
},
- skills: {
+ capabilities: {
title: 'المهارات والأدوات',
detail: 'تفعيل المهارات ومجموعات الأدوات والمزوّدين'
},
@@ -1911,7 +1911,7 @@ export const ar = defineLocale({
},
nav: {
'new-session': 'جلسة جديدة',
- skills: 'المهارات',
+ capabilities: 'المهارات',
messaging: 'المراسلة',
artifacts: 'العناصر',
chat: 'المحادثة',
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 2b9922704c3..6192d915d2a 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -382,7 +382,7 @@ export const en: Translations = {
'nav.commandCenter': 'Open command center',
'nav.settings': 'Open settings',
'nav.profiles': 'Open profiles',
- 'nav.skills': 'Open skills',
+ 'nav.capabilities': 'Open skills',
'nav.messaging': 'Open messaging',
'nav.artifacts': 'Open artifacts',
'nav.cron': 'Open scheduled jobs',
@@ -2015,7 +2015,7 @@ export const en: Translations = {
nav: {
newChat: { title: 'New session', detail: 'Start a fresh session' },
settings: { title: 'Settings', detail: 'Configure Hermes desktop' },
- skills: { title: 'Capabilities', detail: 'Skills, tools, MCP servers, and plugins' },
+ capabilities: { title: 'Capabilities', detail: 'Skills, tools, MCP servers, and plugins' },
messaging: { title: 'Messaging', detail: 'Set up Telegram, Slack, Discord, and more' },
artifacts: { title: 'Artifacts', detail: 'Browse generated outputs' }
},
@@ -2735,7 +2735,7 @@ export const en: Translations = {
profileRail: 'Profile rail',
nav: {
'new-session': 'New session',
- skills: 'Capabilities',
+ capabilities: 'Capabilities',
messaging: 'Messaging',
artifacts: 'Artifacts',
cron: 'Scheduled jobs'
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index 8f34f3d4ea2..cb3925206c7 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -1657,7 +1657,7 @@ export const ja = defineLocale({
nav: {
newChat: { title: '新しいセッション', detail: '新しいセッションを開始' },
settings: { title: '設定', detail: 'Hermes デスクトップを設定' },
- skills: { title: 'スキルとツール', detail: 'スキル、ツールセット、プロバイダーを有効化' },
+ capabilities: { title: 'スキルとツール', detail: 'スキル、ツールセット、プロバイダーを有効化' },
messaging: { title: 'メッセージング', detail: 'Telegram、Slack、Discord などを設定' },
artifacts: { title: 'アーティファクト', detail: '生成された出力を閲覧' }
},
@@ -2237,7 +2237,7 @@ export const ja = defineLocale({
},
nav: {
'new-session': '新しいセッション',
- skills: 'スキルとツール',
+ capabilities: 'スキルとツール',
messaging: 'メッセージング',
artifacts: 'アーティファクト',
cron: 'スケジュール済みジョブ'
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index 7fbf02e189b..5a50258192d 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -304,7 +304,7 @@ export const ru = defineLocale({
'nav.commandCenter': 'Открыть центр команд',
'nav.settings': 'Открыть настройки',
'nav.profiles': 'Открыть профили',
- 'nav.skills': 'Открыть навыки',
+ 'nav.capabilities': 'Открыть навыки',
'nav.messaging': 'Открыть мессенджеры',
'nav.artifacts': 'Открыть артефакты',
'nav.cron': 'Открыть запланированные задачи',
@@ -1828,7 +1828,7 @@ export const ru = defineLocale({
nav: {
newChat: { title: 'Новый сеанс', detail: 'Начать новый сеанс' },
settings: { title: 'Настройки', detail: 'Настройка Hermes desktop' },
- skills: { title: 'Возможности', detail: 'Навыки, инструменты и MCP-серверы' },
+ capabilities: { title: 'Возможности', detail: 'Навыки, инструменты и MCP-серверы' },
messaging: { title: 'Сообщения', detail: 'Настройка Telegram, Slack, Discord и других' },
artifacts: { title: 'Артефакты', detail: 'Просмотр сгенерированных результатов' }
},
@@ -2499,7 +2499,7 @@ export const ru = defineLocale({
},
nav: {
'new-session': 'Новый сеанс',
- skills: 'Возможности',
+ capabilities: 'Возможности',
messaging: 'Сообщения',
artifacts: 'Артефакты',
cron: 'Запланированные задачи'
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 5ef1f54d12d..bc729aaa0ce 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -1788,7 +1788,7 @@ export interface Translations {
archivedChats: string
sections: Record<'maintenance' | 'sessions' | 'system' | 'usage', string>
sectionDescriptions: Record<'maintenance' | 'sessions' | 'system' | 'usage', string>
- nav: Record<'newChat' | 'settings' | 'skills' | 'messaging' | 'artifacts', { title: string; detail: string }>
+ nav: Record<'newChat' | 'settings' | 'capabilities' | 'messaging' | 'artifacts', { title: string; detail: string }>
sectionEntries: Record<'sessions' | 'system' | 'usage', { title: string; detail: string }>
providerNavigate: string
providerSessions: string
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index 7d007222d5c..975f75d3e16 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -1669,7 +1669,7 @@ export const zhHant = defineLocale({
nav: {
newChat: { title: '新工作階段', detail: '開始新的工作階段' },
settings: { title: '設定', detail: '設定 Hermes 桌面端' },
- skills: { title: '技能與工具', detail: '啟用技能、工具集和提供方' },
+ capabilities: { title: '技能與工具', detail: '啟用技能、工具集和提供方' },
messaging: { title: '訊息平台', detail: '設定 Telegram、Slack、Discord 等' },
artifacts: { title: '成品', detail: '瀏覽產生的輸出' }
},
@@ -2224,7 +2224,7 @@ export const zhHant = defineLocale({
},
nav: {
'new-session': '新工作階段',
- skills: '技能與工具',
+ capabilities: '技能與工具',
messaging: '訊息平台',
artifacts: '成品',
cron: '排程工作'
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 76c33367243..b019d9c876e 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -344,7 +344,7 @@ export const zh = defineLocale({
'nav.commandCenter': '打开命令中心',
'nav.settings': '打开设置',
'nav.profiles': '打开配置',
- 'nav.skills': '打开技能',
+ 'nav.capabilities': '打开技能',
'nav.messaging': '打开消息',
'nav.artifacts': '打开制品',
'nav.cron': '打开定时任务',
@@ -2167,7 +2167,7 @@ export const zh = defineLocale({
nav: {
newChat: { title: '新建会话', detail: '开始一个新会话' },
settings: { title: '设置', detail: '配置 Hermes 桌面端' },
- skills: { title: '技能与工具', detail: '启用技能、工具集与提供方' },
+ capabilities: { title: '技能与工具', detail: '启用技能、工具集与提供方' },
messaging: { title: '消息平台', detail: '配置 Telegram、Slack、Discord 等' },
artifacts: { title: '产物', detail: '浏览生成的输出' }
},
@@ -2872,7 +2872,7 @@ export const zh = defineLocale({
},
nav: {
'new-session': '新建会话',
- skills: '技能与工具',
+ capabilities: '技能与工具',
messaging: '消息平台',
artifacts: '产物',
cron: '定时任务'
diff --git a/apps/desktop/src/lib/keybinds/actions.ts b/apps/desktop/src/lib/keybinds/actions.ts
index a20379a3162..553c134ba33 100644
--- a/apps/desktop/src/lib/keybinds/actions.ts
+++ b/apps/desktop/src/lib/keybinds/actions.ts
@@ -109,7 +109,7 @@ export const KEYBIND_ACTIONS: readonly KeybindActionMeta[] = [
{ id: 'nav.commandCenter', category: 'navigation', defaults: ['mod+.'] },
{ id: 'nav.settings', category: 'navigation', defaults: ['mod+,'] },
{ id: 'nav.profiles', category: 'navigation', defaults: [] },
- { id: 'nav.skills', category: 'navigation', defaults: [] },
+ { id: 'nav.capabilities', category: 'navigation', defaults: [] },
{ id: 'nav.messaging', category: 'navigation', defaults: [] },
{ id: 'nav.artifacts', category: 'navigation', defaults: [] },
{ id: 'nav.cron', category: 'navigation', defaults: [] },
diff --git a/apps/desktop/src/lib/keybinds/combo.test.ts b/apps/desktop/src/lib/keybinds/combo.test.ts
index 0d8fffd3957..82a20445366 100644
--- a/apps/desktop/src/lib/keybinds/combo.test.ts
+++ b/apps/desktop/src/lib/keybinds/combo.test.ts
@@ -150,7 +150,7 @@ describe('actionAllowedInInput', () => {
expect(actionAllowedInInput('session.prev', 'ctrl+shift+tab')).toBe(true)
expect(actionAllowedInInput('nav.commandPalette', 'mod+k')).toBe(true)
expect(actionAllowedInInput('view.findInPage', 'mod+f')).toBe(true)
- expect(actionAllowedInInput('nav.skills', 'mod+k')).toBe(true)
+ expect(actionAllowedInInput('nav.capabilities', 'mod+k')).toBe(true)
expect(actionAllowedInInput('view.showTerminal', 'ctrl+`')).toBe(true)
expect(actionAllowedInInput('profile.next', 'mod+shift+]')).toBe(true)
diff --git a/apps/desktop/src/lib/tips/catalog.ts b/apps/desktop/src/lib/tips/catalog.ts
index 157968c85e9..deedc1612e4 100644
--- a/apps/desktop/src/lib/tips/catalog.ts
+++ b/apps/desktop/src/lib/tips/catalog.ts
@@ -45,7 +45,7 @@ export type TipId =
// to stand alone, because that is how they arrive.
export const TIP_CATALOG: readonly TipDef[] = [
{ id: 'new-session', keybind: 'session.new', side: 'right', targets: ['[data-tour="sidebar-nav-new-session"]'] },
- { id: 'skills', keybind: 'nav.skills', side: 'right', targets: ['[data-tour="sidebar-nav-skills"]'] },
+ { id: 'skills', keybind: 'nav.capabilities', side: 'right', targets: ['[data-tour="sidebar-nav-capabilities"]'] },
{ id: 'messaging', keybind: 'nav.messaging', side: 'right', targets: ['[data-tour="sidebar-nav-messaging"]'] },
{ id: 'artifacts', keybind: 'nav.artifacts', side: 'right', targets: ['[data-tour="sidebar-nav-artifacts"]'] },
{ id: 'cron', keybind: 'nav.cron', side: 'right', targets: ['[data-tour="sidebar-nav-cron"]'] },
diff --git a/apps/desktop/src/plugins/hermes-bots/create-agent-lazy-profile.test.tsx b/apps/desktop/src/plugins/hermes-bots/create-agent-lazy-profile.test.tsx
index 25a6d746a2f..613f1a369fb 100644
--- a/apps/desktop/src/plugins/hermes-bots/create-agent-lazy-profile.test.tsx
+++ b/apps/desktop/src/plugins/hermes-bots/create-agent-lazy-profile.test.tsx
@@ -22,7 +22,7 @@ import type * as DataModule from './data'
import { translateBots } from './i18n-test-helper'
import type { RosterRow } from './types'
-interface SkillsViewProps {
+interface CapabilitiesViewProps {
fixedConnection?: string
fixedProfile?: string
}
@@ -32,19 +32,19 @@ const mocks = vi.hoisted(() => ({
createCanonicalChat: vi.fn(async () => 'session-1'),
deleteBot: vi.fn(async () => undefined),
/** Flipped off to model a desktop build that predates the live surface. */
- hasSkillsView: { value: true },
+ hasCapabilitiesView: { value: true },
notify: vi.fn(),
notifyError: vi.fn(),
request: vi.fn(),
requestProfile: vi.fn(async () => ({})),
saveBotMeta: vi.fn(),
- skillsView: [] as SkillsViewProps[]
+ skillsView: [] as CapabilitiesViewProps[]
}))
vi.mock('@hermes/plugin-sdk', async importOriginal => {
const original = await importOriginal<typeof HermesSdk>()
- const SkillsViewStub = (props: SkillsViewProps) => {
+ const CapabilitiesViewStub = (props: CapabilitiesViewProps) => {
mocks.skillsView.push(props)
return null
@@ -52,7 +52,7 @@ vi.mock('@hermes/plugin-sdk', async importOriginal => {
// Builds that route `fixedConnection` get the live Capabilities tab for
// remote targets too, pinned to the target machine's backend.
- SkillsViewStub.supportsFixedConnection = true
+ CapabilitiesViewStub.supportsFixedConnection = true
const mocked: Record<string, unknown> = {
...original,
@@ -68,10 +68,10 @@ vi.mock('@hermes/plugin-sdk', async importOriginal => {
usePluginI18n: () => translateBots
}
- Object.defineProperty(mocked, 'SkillsView', {
+ Object.defineProperty(mocked, 'CapabilitiesView', {
configurable: true,
enumerable: true,
- get: () => (mocks.hasSkillsView.value ? SkillsViewStub : undefined)
+ get: () => (mocks.hasCapabilitiesView.value ? CapabilitiesViewStub : undefined)
})
return mocked
@@ -101,8 +101,8 @@ function withQueryClient(children: ReactNode) {
)
}
-async function renderDialog(hasSkillsView: boolean) {
- mocks.hasSkillsView.value = hasSkillsView
+async function renderDialog(hasCapabilitiesView: boolean) {
+ mocks.hasCapabilitiesView.value = hasCapabilitiesView
vi.resetModules()
const { CreateAgentDialog } = await import('./create-dialog')
diff --git a/apps/desktop/src/plugins/hermes-bots/create-dialog.tsx b/apps/desktop/src/plugins/hermes-bots/create-dialog.tsx
index 6c739154bb1..0dad5b8d96f 100644
--- a/apps/desktop/src/plugins/hermes-bots/create-dialog.tsx
+++ b/apps/desktop/src/plugins/hermes-bots/create-dialog.tsx
@@ -66,7 +66,7 @@ import type {
ProfileConfigurePayload,
ProfileDescribeResponse
} from './profile-config'
-import { CheckList, SkillsView, skillsViewRoutesConnections } from './profile-config'
+import { CapabilitiesView, capabilitiesViewRoutesConnections, CheckList } from './profile-config'
import { deleteBot } from './profile-ops'
import { botRosterMeta } from './routing'
import { HubSkillsSection } from './skills-hub'
@@ -195,7 +195,7 @@ export function CreateAgentDialog({ open, onClose, roster }: CreateAgentDialogPr
: host.request(method, params)
// Set once ensureAgentCreated() materializes the profile for the live
- // Capabilities tab (SkillsView needs a real backend to point at). State —
+ // Capabilities tab (CapabilitiesView needs a real backend to point at). State —
// not just createdRef — because the render must flip when it lands.
const [createdForCaps, setCreatedForCaps] = useState<null | string>(null)
const [caps, setCaps] = useState<CapabilityCatalog | null>(null)
@@ -721,7 +721,7 @@ export function CreateAgentDialog({ open, onClose, roster }: CreateAgentDialogPr
}
}}
options={
- SkillsView && (!remoteTarget || skillsViewRoutesConnections)
+ CapabilitiesView && (!remoteTarget || capabilitiesViewRoutesConnections)
? [
{ id: 'general', label: 'General' },
{ id: 'capabilities', label: 'Capabilities' }
@@ -814,9 +814,9 @@ export function CreateAgentDialog({ open, onClose, roster }: CreateAgentDialogPr
<div className="flex justify-center py-4">
<GlyphSpinner className="text-(--ui-text-tertiary)" spinner="breathe" />
</div>
- ) : SkillsView ? (
+ ) : CapabilitiesView ? (
<ResizableFrame height={440} minHeight={280}>
- <SkillsView
+ <CapabilitiesView
embedded
fixedProfile={createdForCaps}
{...(remoteTarget
diff --git a/apps/desktop/src/plugins/hermes-bots/group-test-utils.ts b/apps/desktop/src/plugins/hermes-bots/group-test-utils.ts
index 4594f43137a..f537265e3a8 100644
--- a/apps/desktop/src/plugins/hermes-bots/group-test-utils.ts
+++ b/apps/desktop/src/plugins/hermes-bots/group-test-utils.ts
@@ -442,7 +442,7 @@ export async function pluginSdkMock(host: Record<string, unknown>) {
computed: nanostores.computed,
createBudgetedLoop: undefined,
host,
- SkillsView: undefined,
+ CapabilitiesView: undefined,
MessageTextContent: undefined,
Streamdown: undefined,
queryClient: { invalidateQueries: () => undefined },
diff --git a/apps/desktop/src/plugins/hermes-bots/legacy-sdk-compat.test.ts b/apps/desktop/src/plugins/hermes-bots/legacy-sdk-compat.test.ts
index acbf19c8ce4..673364158ac 100644
--- a/apps/desktop/src/plugins/hermes-bots/legacy-sdk-compat.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/legacy-sdk-compat.test.ts
@@ -1,7 +1,7 @@
/**
* Bot Mode has to keep linking against an OLDER desktop SDK.
*
- * `McpTab`, `ToolsetConfigPanel` and `SkillsView` are capability exports: the
+ * `McpTab`, `ToolsetConfigPanel` and `CapabilitiesView` are capability exports: the
* shell that hosts the plugin may predate any of them. Every use site is
* therefore guarded, and the plugin module graph must evaluate — and still
* hand back a registrable plugin — when all three are missing. A bare
@@ -12,7 +12,7 @@
import { describe, expect, it, vi } from 'vitest'
/** Names an older SDK is allowed not to export. */
-const OPTIONAL_CAPABILITY_EXPORTS = new Set(['McpTab', 'SkillsView', 'ToolsetConfigPanel'])
+const OPTIONAL_CAPABILITY_EXPORTS = new Set(['McpTab', 'CapabilitiesView', 'ToolsetConfigPanel'])
vi.mock('@hermes/plugin-sdk', async () => {
const { atom } = await import('nanostores')
@@ -65,13 +65,13 @@ describe('an SDK without the optional capability exports', () => {
expect(typeof plugin.register).toBe('function')
})
- it('leaves the SkillsView connection-routing capability off', async () => {
- // `skillsViewRoutesConnections` gates whether a source-scoped bot may open
- // the Capabilities tab at all — with no SkillsView it must read false, not
+ it('leaves the CapabilitiesView connection-routing capability off', async () => {
+ // `capabilitiesViewRoutesConnections` gates whether a source-scoped bot may open
+ // the Capabilities tab at all — with no CapabilitiesView it must read false, not
// throw on the missing export.
- const { SkillsView, skillsViewRoutesConnections } = await import('./profile-config')
+ const { CapabilitiesView, capabilitiesViewRoutesConnections } = await import('./profile-config')
- expect(SkillsView).toBeUndefined()
- expect(skillsViewRoutesConnections).toBe(false)
+ expect(CapabilitiesView).toBeUndefined()
+ expect(capabilitiesViewRoutesConnections).toBe(false)
})
})
diff --git a/apps/desktop/src/plugins/hermes-bots/profile-config-capabilities.test.tsx b/apps/desktop/src/plugins/hermes-bots/profile-config-capabilities.test.tsx
index d46a01dbf5d..226d1a59cb4 100644
--- a/apps/desktop/src/plugins/hermes-bots/profile-config-capabilities.test.tsx
+++ b/apps/desktop/src/plugins/hermes-bots/profile-config-capabilities.test.tsx
@@ -1,13 +1,13 @@
/**
* The bot editor's Advanced section renders the REAL core Capabilities
- * surfaces — SkillsView (installed skills + hub installs + detail),
+ * surfaces — CapabilitiesView (installed skills + hub installs + detail),
* ToolsetConfigPanel (per-toolset env/keys/model/post-setup) and McpTab
* (per-server enable + OAuth + API keys) — pinned to the bot's own profile,
* instead of bare checkbox stand-ins.
*
* All three are optional SDK namespace exports (hermes-agent#87317), so every
* use site is feature-detected and older desktop builds keep the staged
- * checklist UI. The sharp edge is a REMOTE bot on a build whose SkillsView
+ * checklist UI. The sharp edge is a REMOTE bot on a build whose CapabilitiesView
* predates `supportsFixedConnection`: rendering the live surface there would
* read and write the ACTIVE gateway's skills under the remote bot's name —
* the wrong machine — so those builds must fail closed to "staged only".
@@ -33,7 +33,7 @@ interface StubProps {
/** The optional SDK exports, swapped per test to model each desktop build. */
const sdk = vi.hoisted(() => {
- const seen: Record<string, StubProps[]> = { McpTab: [], SkillsView: [], ToolsetConfigPanel: [] }
+ const seen: Record<string, StubProps[]> = { McpTab: [], CapabilitiesView: [], ToolsetConfigPanel: [] }
const spy = (name: string) => {
const Stub = (props: StubProps) => {
@@ -77,7 +77,7 @@ vi.mock('@hermes/plugin-sdk', async importOriginal => {
usePluginI18n: () => translateBots
}
- for (const name of ['McpTab', 'SkillsView', 'ToolsetConfigPanel']) {
+ for (const name of ['McpTab', 'CapabilitiesView', 'ToolsetConfigPanel']) {
Object.defineProperty(mocked, name, { configurable: true, enumerable: true, get: () => sdk.exports[name] })
}
@@ -178,10 +178,10 @@ afterEach(() => {
cleanup()
})
-describe('a build whose SkillsView cannot route connections', () => {
+describe('a build whose CapabilitiesView cannot route connections', () => {
const oldBuild = () => ({
McpTab: sdk.spy('McpTab'),
- SkillsView: sdk.spy('SkillsView'),
+ CapabilitiesView: sdk.spy('CapabilitiesView'),
ToolsetConfigPanel: sdk.spy('ToolsetConfigPanel')
})
@@ -191,7 +191,7 @@ describe('a build whose SkillsView cannot route connections', () => {
// The model catalog settles first so the picker is past its spinner.
expect(await screen.findByText('Provider')).toBeTruthy()
expect(screen.getByText(/Remote capabilities require a newer desktop/)).toBeTruthy()
- expect(sdk.seen.SkillsView).toHaveLength(0)
+ expect(sdk.seen.CapabilitiesView).toHaveLength(0)
expect(sdk.seen.McpTab).toHaveLength(0)
expect(sdk.seen.ToolsetConfigPanel).toHaveLength(0)
expect(screen.queryByText('Skills Hub')).toBeNull()
@@ -228,38 +228,38 @@ describe('a build whose SkillsView cannot route connections', () => {
})
})
-describe('a connection-aware SkillsView', () => {
+describe('a connection-aware CapabilitiesView', () => {
it('receives the connection and the BACKEND profile separately', async () => {
- const Routed = sdk.spy('SkillsView')
+ const Routed = sdk.spy('CapabilitiesView')
;(Routed as unknown as { supportsFixedConnection: boolean }).supportsFixedConnection = true
- await renderEditor({ SkillsView: Routed }, remoteBot)
+ await renderEditor({ CapabilitiesView: Routed }, remoteBot)
// The alias's logical name is `default`; the backend row it activates into
// is `backend-default`. Pinning the logical name would edit the wrong one.
- expect(sdk.seen.SkillsView[0]).toMatchObject({
+ expect(sdk.seen.CapabilitiesView[0]).toMatchObject({
fixedConnection: 'remote-a',
fixedProfile: 'backend-default'
})
})
it('#93492: degrades an orphaned row to its own name instead of throwing', async () => {
- const Routed = sdk.spy('SkillsView')
+ const Routed = sdk.spy('CapabilitiesView')
;(Routed as unknown as { supportsFixedConnection: boolean }).supportsFixedConnection = true
// A row whose owning connection was removed resolves to no route at all.
// The editor renders on the render path, so a throw here would take the
// whole pane down through the dialog's error boundary.
- await renderEditor({ SkillsView: Routed }, { ...remoteBot, connectionId: '', route: undefined })
+ await renderEditor({ CapabilitiesView: Routed }, { ...remoteBot, connectionId: '', route: undefined })
- expect(sdk.seen.SkillsView[0]).toEqual({ embedded: true, fixedProfile: 'default' })
+ expect(sdk.seen.CapabilitiesView[0]).toEqual({ embedded: true, fixedProfile: 'default' })
})
})
describe('a build with no Capabilities exports at all', () => {
- const bareBuild = { McpTab: undefined, SkillsView: undefined, ToolsetConfigPanel: undefined }
+ const bareBuild = { McpTab: undefined, CapabilitiesView: undefined, ToolsetConfigPanel: undefined }
it('keeps the checkbox MCP list with its inline setup button', async () => {
await renderEditor(bareBuild, localBot)
diff --git a/apps/desktop/src/plugins/hermes-bots/profile-config.test.ts b/apps/desktop/src/plugins/hermes-bots/profile-config.test.ts
index 2ddc99494ea..34e7f0fdf70 100644
--- a/apps/desktop/src/plugins/hermes-bots/profile-config.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/profile-config.test.ts
@@ -64,7 +64,7 @@ vi.mock('@hermes/plugin-sdk', async () => {
SelectItem: () => null,
SelectTrigger: () => null,
SelectValue: () => null,
- SkillsView: undefined,
+ CapabilitiesView: undefined,
surfaceModelSwitchConfirm: confirmMock,
Textarea: () => null,
ToolsetConfigPanel: undefined,
diff --git a/apps/desktop/src/plugins/hermes-bots/profile-config.tsx b/apps/desktop/src/plugins/hermes-bots/profile-config.tsx
index 18ab72da5e7..a431bcfe9ca 100644
--- a/apps/desktop/src/plugins/hermes-bots/profile-config.tsx
+++ b/apps/desktop/src/plugins/hermes-bots/profile-config.tsx
@@ -34,13 +34,13 @@ import type { RosterRow } from './types'
// The Partial is the point: both are guarded at every use site because an older
// build (or a stripped harness namespace) simply doesn't export them.
const { McpTab, ToolsetConfigPanel }: Partial<Pick<typeof sdk, 'McpTab' | 'ToolsetConfigPanel'>> = sdk
-export const SkillsView = typeof sdk === 'undefined' ? undefined : sdk.SkillsView
-// TRUE only on builds whose SkillsView routes `fixedConnection` to the pinned
-// registry connection's backend. Older builds export SkillsView WITHOUT the
+export const CapabilitiesView = typeof sdk === 'undefined' ? undefined : sdk.CapabilitiesView
+// TRUE only on builds whose CapabilitiesView routes `fixedConnection` to the pinned
+// registry connection's backend. Older builds export CapabilitiesView WITHOUT the
// prop — rendering it for a remote-target draft there would read/write the
// ACTIVE gateway's skills under the remote bot's name (the wrong machine),
// so those builds keep the staged checklists for remote targets.
-export const skillsViewRoutesConnections = Boolean(SkillsView && SkillsView.supportsFixedConnection)
+export const capabilitiesViewRoutesConnections = Boolean(CapabilitiesView && CapabilitiesView.supportsFixedConnection)
// ── advanced profile config (skills / toolsets / model / SOUL) ──────────────
//
@@ -255,7 +255,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC
// Render THAT instead of the checkbox stand-ins; writes go straight to the
// bot's backend, so the dirty-section staging below only carries
// model + SOUL on these builds. Older builds keep the full checklist UI.
- if (SkillsView && (!botRoute || skillsViewRoutesConnections)) {
+ if (CapabilitiesView && (!botRoute || capabilitiesViewRoutesConnections)) {
return (
<div className="grid gap-4">
<ModelPicker
@@ -275,7 +275,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC
{labeled(
'Capabilities (applies immediately — skills, tools, MCP)',
<ResizableFrame height={460} minHeight={300}>
- <SkillsView
+ <CapabilitiesView
embedded
fixedProfile={backendProfile}
{...(botRoute
@@ -304,7 +304,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC
)
}
- if (bot?.sourceScoped && botRoute?.mode === 'remote' && !skillsViewRoutesConnections) {
+ if (bot?.sourceScoped && botRoute?.mode === 'remote' && !capabilitiesViewRoutesConnections) {
return (
<div className="grid gap-4">
<ModelPicker
diff --git a/apps/desktop/src/sdk/index.ts b/apps/desktop/src/sdk/index.ts
index 229a219ea80..1d401ac276c 100644
--- a/apps/desktop/src/sdk/index.ts
+++ b/apps/desktop/src/sdk/index.ts
@@ -1538,6 +1538,24 @@ export const host = {
// -- react bridge -------------------------------------------------------------
+/** THE whole Capabilities surface (Skills / Tools / MCP tabs, installed
+ * lists, full-skill detail pane, embedded hub picker with one-click
+ * installs). For plugin dialogs pass `embedded` (tab state stays local —
+ * never touches the page router) and `fixedProfile` to pin every tab to one
+ * bot's backend; the internal profile selector hides itself. Add
+ * `fixedConnection` (registry connection id) to pin a bot living on another
+ * registered gateway — probe `CapabilitiesView.supportsFixedConnection` first;
+ * builds without it would route the pin to the ACTIVE gateway. Bot Mode's
+ * Advanced section is the reference consumer. */
+export { CapabilitiesView } from '@/app/capabilities'
+
+// -- ui: the design language --------------------------------------------------
+
+/** THE full MCP tab core Settings renders — per-server enable + OAuth sign-in
+ * + API-key setup + live probes, not a checkbox list. Route-decoupled so it
+ * renders anywhere (a plugin dialog); pass a live `gateway` (see
+ * `host.getGateway()`) and an optional `profile` to scope it to one bot. */
+export { McpTab } from '@/app/capabilities/mcp/mcp-tab'
// Every contribution surface, plugin-reachable: register keybinds, palette
// commands, routes, themes, panes, composer extensions, and bar items with
// the same area ids + payload types core uses.
@@ -1548,9 +1566,6 @@ export {
type ComposerAttachmentProvider,
type ComposerMiddleware
} from '@/app/chat/composer/contrib'
-
-// -- ui: the design language --------------------------------------------------
-
/** THE session status dot — the one primitive the sidebar row, the pane tabs
* and the session switcher render, so a session's status can never disagree
* between surfaces. Pass the STORED session id and it resolves the rest
@@ -1628,21 +1643,6 @@ export {
} from '@/app/shell/model-catalog-menu'
export type { StatusbarItem } from '@/app/shell/statusbar-controls'
export type { TitlebarTool } from '@/app/shell/titlebar-controls'
-/** THE whole Capabilities surface (Skills / Tools / MCP tabs, installed
- * lists, full-skill detail pane, embedded hub picker with one-click
- * installs). For plugin dialogs pass `embedded` (tab state stays local —
- * never touches the page router) and `fixedProfile` to pin every tab to one
- * bot's backend; the internal profile selector hides itself. Add
- * `fixedConnection` (registry connection id) to pin a bot living on another
- * registered gateway — probe `SkillsView.supportsFixedConnection` first;
- * builds without it would route the pin to the ACTIVE gateway. Bot Mode's
- * Advanced section is the reference consumer. */
-export { SkillsView } from '@/app/skills'
-/** THE full MCP tab core Settings renders — per-server enable + OAuth sign-in
- * + API-key setup + live probes, not a checkbox list. Route-decoupled so it
- * renders anywhere (a plugin dialog); pass a live `gateway` (see
- * `host.getGateway()`) and an optional `profile` to scope it to one bot. */
-export { McpTab } from '@/app/skills/mcp-tab'
/** Canonical raw message renderer: applies Desktop message transforms (including
* `MEDIA:` delivery directives) and the same rich Markdown/media components as
* core chat. Prefer this over raw Streamdown for transcript-style messages. */
diff --git a/apps/desktop/src/store/hub-actions.ts b/apps/desktop/src/store/hub-actions.ts
index d1cf3f320da..e89830500e1 100644
--- a/apps/desktop/src/store/hub-actions.ts
+++ b/apps/desktop/src/store/hub-actions.ts
@@ -1,5 +1,8 @@
import { atom, map } from 'nanostores'
+// The Capabilities Skills-list query key, imported rather than re-spelled so a
+// hub (un)install updates the Skills tab, not just the hub.
+import { SKILLS_QUERY_KEY } from '@/app/capabilities/skills/skills-data'
import {
getActionStatus,
installSkillFromHub,
@@ -20,9 +23,6 @@ const POLL_MS = 1200
// Shared with hub.tsx's sources useQuery so a finished action refreshes the
// installed map.
export const HUB_SOURCES_KEY = ['skill-hub-sources'] as const
-// The Capabilities Skills-list query key (see app/skills/index.tsx) — kept in
-// sync here so a hub (un)install updates the Skills tab, not just the hub.
-const SKILLS_LIST_KEY = ['skills-list'] as const
// The built-in optional-skills catalog rows in the Skills tab: an install
// flips one of them to an installed (toggle) row, so the catalog's
// installed-flags must refetch alongside the skills list.
@@ -125,7 +125,7 @@ async function runHubAction(
// Refresh the hub's installed map AND the Capabilities Skills list — a hub
// (un)install adds/removes a skill, so its count/rows must update too.
void queryClient.invalidateQueries({ queryKey: HUB_SOURCES_KEY })
- void queryClient.invalidateQueries({ queryKey: SKILLS_LIST_KEY })
+ void queryClient.invalidateQueries({ queryKey: SKILLS_QUERY_KEY })
void queryClient.invalidateQueries({ queryKey: OFFICIAL_SKILLS_KEY })
// …and the composer's `/` list, which caches the command catalog for an
// hour and would otherwise keep offering the skill we just removed.
diff --git a/apps/desktop/src/store/mcp-health.ts b/apps/desktop/src/store/mcp-health.ts
index d2d37ffec2e..d3ca78ffdaa 100644
--- a/apps/desktop/src/store/mcp-health.ts
+++ b/apps/desktop/src/store/mcp-health.ts
@@ -102,7 +102,7 @@ let offProfile: (() => void) | null = null
// scrolls to and focuses the server so its ServerConfig pane (with the
// Authenticate button) is one click away.
function openMcpServerPage(name: string): void {
- window.location.hash = `#/skills?tab=mcp&server=${encodeURIComponent(name)}`
+ window.location.hash = `#/capabilities?tab=mcp&server=${encodeURIComponent(name)}`
}
// "Disable" from the toast: `enabled: false` in config.yaml (the server stays
diff --git a/apps/desktop/src/store/route-tiles.ts b/apps/desktop/src/store/route-tiles.ts
index 0713952c802..d2e2b6cec03 100644
--- a/apps/desktop/src/store/route-tiles.ts
+++ b/apps/desktop/src/store/route-tiles.ts
@@ -10,7 +10,7 @@ import type { SplitDir } from './session-states'
* the page analog of session tiles. Persisted by path so they re-open on boot.
*/
export interface RouteTile {
- /** The route path this tile renders, e.g. `/skills`. */
+ /** The route path this tile renders, e.g. `/capabilities`. */
path: string
/** Edge to dock against main on adoption (default right). */
dir?: SplitDir
diff --git a/apps/desktop/src/store/session.test.ts b/apps/desktop/src/store/session.test.ts
index cf49cbc6bb3..ee875f084bc 100644
--- a/apps/desktop/src/store/session.test.ts
+++ b/apps/desktop/src/store/session.test.ts
@@ -1335,7 +1335,7 @@ describe('remembered route (per profile)', () => {
})
it('discards legacy unsuffixed keys on first read (zero-migration, refuse-to-guess)', () => {
- localStorage.setItem('hermes.desktop.lastRoute', '/skills')
+ localStorage.setItem('hermes.desktop.lastRoute', '/capabilities')
// Reading from any profile discards the legacy key.
expect(getRememberedRoute('default')).toBeNull()
diff --git a/apps/desktop/src/store/settings-scope.ts b/apps/desktop/src/store/settings-scope.ts
index fe9f8f99a73..a4c878f1ad0 100644
--- a/apps/desktop/src/store/settings-scope.ts
+++ b/apps/desktop/src/store/settings-scope.ts
@@ -59,7 +59,7 @@ export function setSettingsScope(name: string): void {
// An app-wide profile switch re-homes every settings surface to the new
// backend; a surviving override would silently keep edits pointed at the
// previous target. Same drop-the-override contract as the Capabilities
-// selector (app/skills useOnProfileSwitch).
+// selector (app/capabilities useOnProfileSwitch).
let lastActiveProfile = normalizeProfileKey($activeGatewayProfile.get())
$activeGatewayProfile.subscribe(value => {
diff --git a/apps/desktop/src/store/terminal-backend-warning.test.ts b/apps/desktop/src/store/terminal-backend-warning.test.ts
index fc69b5a625e..721ad79fa8c 100644
--- a/apps/desktop/src/store/terminal-backend-warning.test.ts
+++ b/apps/desktop/src/store/terminal-backend-warning.test.ts
@@ -45,7 +45,7 @@ test('a selected non-local backend that is not ready warns once with Use Local /
expect(`${toast?.title} ${toast?.message} ${toast?.action?.label}`).not.toMatch(/backend/i)
toast?.action?.onClick()
- expect($routeRequest.get()?.path).toBe('/skills?tab=toolsets')
+ expect($routeRequest.get()?.path).toBe('/capabilities?tab=toolsets')
toast?.secondaryAction?.onClick()
expect(selectTerminalBackend).toHaveBeenCalledWith('local')
diff --git a/apps/desktop/src/store/terminal-backend-warning.ts b/apps/desktop/src/store/terminal-backend-warning.ts
index 9c6238e5b7f..781e145e2aa 100644
--- a/apps/desktop/src/store/terminal-backend-warning.ts
+++ b/apps/desktop/src/store/terminal-backend-warning.ts
@@ -13,7 +13,7 @@ import type { TerminalBackendInfo } from '@/types/hermes'
* is an older/remote backend, not a broken terminal.
*/
-const TERMINAL_TOOLSET_ROUTE = '/skills?tab=toolsets'
+const TERMINAL_TOOLSET_ROUTE = '/capabilities?tab=toolsets'
const TOAST_ID = 'terminal-backend-unavailable'
/** The active backend row when it is selected but not ready, else null. */
diff --git a/evals/desktop_mcp_oauth/renderer_lifecycle.mjs b/evals/desktop_mcp_oauth/renderer_lifecycle.mjs
index 4f40f969f4d..ead631bb41a 100644
--- a/evals/desktop_mcp_oauth/renderer_lifecycle.mjs
+++ b/evals/desktop_mcp_oauth/renderer_lifecycle.mjs
@@ -59,7 +59,7 @@ wss.on('connection', ws =>
)
const entry = `import React from 'react'; import {createRoot} from 'react-dom/client';
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
-import {McpTab} from '${repo}/apps/desktop/src/app/skills/mcp-tab.tsx';
+import {McpTab} from '${repo}/apps/desktop/src/app/capabilities/mcp/mcp-tab.tsx';
import {setApiRequestProfile,setApiRequestConnection} from '${repo}/apps/desktop/src/api/client.ts';
setApiRequestProfile('profile-b');setApiRequestConnection('fixture-remote');
const queryClient=new QueryClient({defaultOptions:{queries:{retry:false}}});function Probe(){const [profile,setProfile]=React.useState('profile-b');const [shown,setShown]=React.useState(true);window.cancelFlow=()=>setProfile('profile-c');window.unmountFlow=()=>setShown(false);return <QueryClientProvider client={queryClient}>{shown && <McpTab gateway={null} profile={{connectionId:'fixture-remote',profile}} />}</QueryClientProvider>};createRoot(document.getElementById('root')).render(<Probe/>);`