The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(desktop): Capabilities-wide profile scoping + one-click hub installs on the Skills tab
Teknium9c58a78a7d80
diff --git a/apps/desktop/src/app/learning/archive-skill-confirm-dialog.tsx b/apps/desktop/src/app/learning/archive-skill-confirm-dialog.tsxindex 5a4131c74f5..6bac1220069 100644--- a/apps/desktop/src/app/learning/archive-skill-confirm-dialog.tsx+++ b/apps/desktop/src/app/learning/archive-skill-confirm-dialog.tsx@@ -9,8 +9,8 @@ export function notifySkillArchived(t: Translations): void {notify({ kind: 'success', message: t.skills.skillArchivedMessage, title: t.skills.skillArchivedTitle })}-export async function archiveLearningSkill(id: string): Promise<void> {- const res = await deleteLearningNode(id)+export async function archiveLearningSkill(id: string, profile?: null | string): Promise<void> {+ const res = await deleteLearningNode(id, profile)if (!res.ok) {throw new Error(res.message || 'Archive failed')@@ -32,6 +32,9 @@ interface ArchiveSkillConfirmDialogProps {onFailure?: (err: unknown, skillName: string) => voidonSuccess?: () => voidopen: boolean+ /** Capabilities profile-scope override — archive against THIS profile's+ * backend; undefined/null keeps the app-wide active profile. */+ profile?: null | stringskillId: stringskillName: string}@@ -43,6 +46,7 @@ export function ArchiveSkillConfirmDialog({onFailure,onSuccess,open,+ profile,skillId,skillName}: ArchiveSkillConfirmDialogProps) {@@ -59,7 +63,7 @@ export function ArchiveSkillConfirmDialog({const rollback = onApply()fireOptimistic(- archiveLearningSkill(skillId).then(() => {+ archiveLearningSkill(skillId, profile).then(() => {notifySkillArchived(t)onSuccess?.()}),diff --git a/apps/desktop/src/app/skills/embedded-hub-picker.tsx b/apps/desktop/src/app/skills/embedded-hub-picker.tsxnew file mode 100644index 00000000000..8e2d2959ed1--- /dev/null+++ b/apps/desktop/src/app/skills/embedded-hub-picker.tsx@@ -0,0 +1,118 @@+import { useEffect, useState } from 'react'++import { Button } from '@/components/ui/button'+import { useI18n } from '@/i18n'+import { installHubSkill } from '@/store/hub-actions'+import { notify, notifyError } from '@/store/notifications'++// The REAL Skills Hub page (docs site) embedded as a one-click picker — the+// same trick the Bot Mode agent editor uses. `?embed=picker` hides the docs+// chrome and adds a "+ Add to this Agent" button per card, which posts+// { type: 'hermes-skill-pick', name, identifier, installCmd, source }+// to the parent window. We validate the origin and route the install through+// the standard hub action pipeline (background action + tailed log + Skills+// list invalidation), scoped to the Capabilities profile selector.+const HUB_ORIGIN = 'https://hermes-agent.nousresearch.com'+const HUB_PICKER_URL = `${HUB_ORIGIN}/docs/skills?embed=picker`++interface SkillPickMessage {+ identifier?: string+ installCmd?: string+ name?: string+ source?: string+ type?: string+}++interface EmbeddedHubPickerProps {+ /** Capabilities profile-scope override — installs land in THIS profile;+ * undefined/null targets the app-wide active profile. */+ profile?: null | string+}++/** Collapsible "browse the full hub" strip for the Skills tab: a resizable+ * iframe of the live Skills Hub where every card installs with one click. */+export function EmbeddedHubPicker({ profile }: EmbeddedHubPickerProps) {+ const { t } = useI18n()+ const h = t.skills.hub+ const [open, setOpen] = useState(false)++ // Picker messages from the embedded hub page. Origin-checked; installs route+ // through the same store pipeline the Browse Hub tab uses, so the action log,+ // optimistic flips, and Skills-list refresh all come for free.+ useEffect(() => {+ if (!open) {+ return undefined+ }++ const onMessage = (event: MessageEvent) => {+ if (event.origin !== HUB_ORIGIN) {+ return+ }++ const data = event.data as SkillPickMessage | null++ if (!data || data.type !== 'hermes-skill-pick' || !data.name) {+ return+ }++ const target = String(data.identifier || data.name)+ const label = String(data.name)++ notify({ kind: 'success', title: h.installStarted(label), message: h.actionLog })+ void installHubSkill(target, profile).catch(err => notifyError(err, h.actionFailed))+ }++ window.addEventListener('message', onMessage)++ return () => window.removeEventListener('message', onMessage)+ }, [h, open, profile])++ return (+ <div className="border-b border-(--ui-stroke-secondary)">+ <div className="flex items-center justify-between px-3 py-1.5">+ <span className="text-[0.7rem] font-medium text-(--ui-text-tertiary)">{h.pickerTitle}</span>+ <Button onClick={() => setOpen(v => !v)} size="xs" variant="text">+ {open ? h.pickerHide : h.pickerBrowse}+ </Button>+ </div>+ {open && (+ <div className="grid gap-1 px-3 pb-2">+ {/* Resizable viewport: native CSS resize handle (bottom-right corner)+ lets the user drag it larger/smaller. The iframe is rendered+ oversized and scaled DOWN (133% × 0.75) so the hub page starts+ zoomed out — the cross-origin page itself can't be styled, but+ scaling the frame is ours. */}+ <div+ style={{+ border: '1px solid var(--ui-stroke-secondary)',+ borderRadius: 8,+ height: 480,+ maxWidth: '100%',+ minHeight: 240,+ minWidth: 320,+ overflow: 'hidden',+ position: 'relative',+ resize: 'vertical',+ width: '100%'+ }}+ >+ <iframe+ sandbox="allow-scripts allow-same-origin"+ src={HUB_PICKER_URL}+ style={{+ background: 'transparent',+ border: 'none',+ height: '133.34%',+ transform: 'scale(0.75)',+ transformOrigin: 'top left',+ width: '133.34%'+ }}+ title={h.pickerTitle}+ />+ </div>+ <p className="px-1 text-[0.65rem] leading-4 text-(--ui-text-quaternary)">{h.pickerHint}</p>+ </div>+ )}+ </div>+ )+}diff --git a/apps/desktop/src/app/skills/hub.tsx b/apps/desktop/src/app/skills/hub.tsxindex 1762b6c7b5a..82acc60a883 100644--- a/apps/desktop/src/app/skills/hub.tsx+++ b/apps/desktop/src/app/skills/hub.tsx@@ -41,6 +41,7 @@ import {updateHubSkills} from '@/store/hub-actions'import { notify, notifyError } from '@/store/notifications'+import { normalizeProfileKey } from '@/store/profile'// Dedup rank when the same skill surfaces from multiple sources — higher trust// wins. Mirrors the backend's unified_search `_TRUST_RANK`.@@ -79,11 +80,13 @@ function verdictTone(policy: string): string {function HubSkillRow({installedName,onPreview,+ profile,rawInstalled,skill}: {installedName: null | stringonPreview: (skill: SkillHubResult) => void+ profile?: null | stringrawInstalled: booleanskill: SkillHubResult}) {@@ -96,12 +99,14 @@ function HubSkillRow({const doInstall = () => {notify({ kind: 'success', title: h.installStarted(skill.name), message: h.actionLog })- void installHubSkill(skill.identifier).catch(err => notifyError(err, h.actionFailed))+ void installHubSkill(skill.identifier, profile).catch(err => notifyError(err, h.actionFailed))}const doUninstall = () => {notify({ kind: 'success', title: h.uninstallStarted(skill.name), message: h.actionLog })- void uninstallHubSkill(skill.identifier, installedName || skill.name).catch(err => notifyError(err, h.actionFailed))+ void uninstallHubSkill(skill.identifier, installedName || skill.name, profile).catch(err =>+ notifyError(err, h.actionFailed)+ )}return (@@ -137,18 +142,22 @@ function HubSkillRow({}interface SkillsHubProps {+ /** Capabilities profile-scope override — hub browsing/installs target THIS+ * profile's backend; undefined/null keeps the app-wide active profile. */+ profile?: null | stringquery: string}-export function SkillsHub({ query }: SkillsHubProps) {+export function SkillsHub({ profile, query }: SkillsHubProps) {const { t } = useI18n()const h = t.skills.hub+ const profileKey = normalizeProfileKey(profile)// Sources + featured + the installed map — one cached fetch, revalidated on// mount and re-fetched (from the store) after an action lands.const sourcesQuery = useQuery({- queryKey: HUB_SOURCES_KEY,- queryFn: getSkillHubSources,+ queryKey: [...HUB_SOURCES_KEY, profileKey],+ queryFn: () => getSkillHubSources(profile),staleTime: 5 * 60_000})@@ -168,8 +177,8 @@ export function SkillsHub({ query }: SkillsHubProps) {const sourceSearches = useQueries({queries: searchableSources.map(source => ({- queryKey: ['skill-hub-search', term, source.id],- queryFn: () => searchSkillsHub(term, source.id),+ queryKey: ['skill-hub-search', term, source.id, profileKey],+ queryFn: () => searchSkillsHub(term, source.id, 20, profile),enabled: term.length > 0,staleTime: 60_000}))@@ -191,8 +200,8 @@ export function SkillsHub({ query }: SkillsHubProps) {const [scanning, setScanning] = useState(false)const previewQuery = useQuery({- queryKey: ['skill-hub-preview', detail?.identifier],- queryFn: () => previewSkillHub(detail!.identifier),+ queryKey: ['skill-hub-preview', detail?.identifier, profileKey],+ queryFn: () => previewSkillHub(detail!.identifier, profile),enabled: detail !== null,staleTime: 5 * 60_000})@@ -201,25 +210,25 @@ export function SkillsHub({ query }: SkillsHubProps) {(identifier: string, name: string) => {setDetail(null)notify({ kind: 'success', title: h.installStarted(name), message: h.actionLog })- void installHubSkill(identifier).catch(err => notifyError(err, h.actionFailed))+ void installHubSkill(identifier, profile).catch(err => notifyError(err, h.actionFailed))},- [h]+ [h, profile])const updateAll = useCallback(() => {notify({ kind: 'success', title: h.updateStarted, message: h.actionLog })- void updateHubSkills().catch(err => notifyError(err, h.actionFailed))- }, [h])+ void updateHubSkills(profile).catch(err => notifyError(err, h.actionFailed))+ }, [h, profile])const runScan = useCallback((identifier: string) => {setScanning(true)- scanSkillHub(identifier)+ scanSkillHub(identifier, profile).then(setScan).catch(err => notifyError(err, h.scanFailed)).finally(() => setScanning(false))},- [h]+ [h, profile])const openDetail = useCallback((skill: SkillHubResult) => {@@ -362,6 +371,7 @@ export function SkillsHub({ query }: SkillsHubProps) {installedName={installed[skill.identifier]?.name ?? null}key={skill.identifier}onPreview={openDetail}+ profile={profile}rawInstalled={Boolean(installed[skill.identifier])}skill={skill}/>diff --git a/apps/desktop/src/app/skills/index.test.tsx b/apps/desktop/src/app/skills/index.test.tsxindex 0982ea1cd76..7aebb7c7a8f 100644--- a/apps/desktop/src/app/skills/index.test.tsx+++ b/apps/desktop/src/app/skills/index.test.tsx@@ -23,14 +23,14 @@ const getProfiles = vi.fn()// observable.vi.mock('@/hermes', async importOriginal => ({...(await importOriginal<typeof HermesApi>()),- getSkills: () => getSkills(),+ getSkills: (profile?: null | string) => getSkills(profile),getToolsets: (profile?: null | string) => getToolsets(profile),- setSkillEnabled: (name: string, enabled: boolean) => setSkillEnabled(name, enabled),+ setSkillEnabled: (name: string, enabled: boolean, profile?: null | string) => setSkillEnabled(name, enabled, profile),setToolsetEnabled: (name: string, enabled: boolean, profile?: null | string) =>setToolsetEnabled(name, enabled, profile),getToolsetConfig: (name: string, profile?: null | string) => getToolsetConfig(name, profile),selectToolsetProvider: (toolset: string, provider: string) => selectToolsetProvider(toolset, provider),- getUsageAnalytics: (days: number) => getUsageAnalytics(days),+ getUsageAnalytics: (days: number, profile?: null | string) => getUsageAnalytics(days, profile),getProfiles: () => getProfiles()}))@@ -174,6 +174,59 @@ describe('SkillsView toolset management', () => {await waitFor(() => expect(getToolsets).toHaveBeenCalledWith('researcher'))})+ it('scopes the Skills tab (and skill toggles) to the profile chosen in the selector', async () => {+ // The selector is Capabilities-WIDE: picking a profile on the Skills tab+ // must refetch the skill list scoped to it, and route toggles there too.+ Element.prototype.scrollIntoView = vi.fn()+ getProfiles.mockResolvedValue({+ profiles: [+ { name: 'default', is_default: true },+ { name: 'researcher', is_default: false }+ ]+ })+ getSkills.mockResolvedValue([+ {+ name: 'web-research',+ description: 'Research the web',+ category: 'research',+ enabled: true,+ usage: 3,+ provenance: 'bundled'+ }+ ])++ const { SkillsView } = await import('./index')+ await act(async () => {+ render(+ <QueryClientProvider client={queryClient}>+ <MemoryRouter initialEntries={['/skills?tab=skills']}>+ <SkillsView />+ </MemoryRouter>+ </QueryClientProvider>+ )+ })++ // The selector renders on the Skills tab too (Capabilities-wide).+ const trigger = await screen.findByRole('combobox')+ await act(async () => {+ fireEvent.click(trigger)+ })+ const option = await screen.findByRole('option', { name: 'researcher' })+ await act(async () => {+ fireEvent.click(option)+ })++ // Skills refetch scoped to the picked profile...+ await waitFor(() => expect(getSkills).toHaveBeenCalledWith('researcher'))++ // ...and a toggle routes its write to that profile as well.+ const sw = await screen.findByRole('switch', { name: 'web-research' })+ await act(async () => {+ fireEvent.click(sw)+ })+ await waitFor(() => expect(setSkillEnabled).toHaveBeenCalledWith('web-research', false, 'researcher'))+ })+it('shows a vision explainer that deep-links to Settings → Models', async () => {// Vision has no TOOL_CATEGORIES provider matrix — its model lives in the// auxiliary model config, so the detail pane must point there instead ofdiff --git a/apps/desktop/src/app/skills/index.tsx b/apps/desktop/src/app/skills/index.tsxindex 11917ddbff4..efdb4dbd5fd 100644--- a/apps/desktop/src/app/skills/index.tsx+++ b/apps/desktop/src/app/skills/index.tsx@@ -24,7 +24,7 @@ import {import { useI18n } from '@/i18n'import { isDesktopToolsetVisible } from '@/lib/desktop-toolsets'import { compactNumber } from '@/lib/format'-import { queryClient, writeCache } from '@/lib/query-client'+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'@@ -57,6 +57,7 @@ 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 { SkillsHub } from './hub'import { McpTab } from './mcp-tab'import { $skillsSortDesc, $toolsetsSortDesc } from './store'@@ -67,39 +68,36 @@ const SKILLS_MODES = ['skills', 'toolsets', 'mcp', 'hub'] as const// 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 constconst TOOLSETS_QUERY_KEY = ['toolsets-list'] as const-// Optimistic write-through: skill toggles/bulk/archive repaint instantly; the-// next background refetch reconciles with the backend. (Toolsets write through-// the profile-scoped query key directly — see handleToggleToolset.)-const setSkills = writeCache<SkillInfo[]>(SKILLS_QUERY_KEY)-// 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-// profile: analytics are profile-scoped, so a switch must not show the previous-// profile's counts. `useRefreshHotkey` still forces a fresh pull.+// 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 * 1000const toolCallsCache = new Map<string, { at: number; value: Record<string, number> }>()-async function loadToolCalls(force = false): Promise<Record<string, number>> {- const key = normalizeProfileKey($activeGatewayProfile.get())- const cached = toolCallsCache.get(key)+async function loadToolCalls(+ scopeKey: string,+ scopeProfile: null | string,+ 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)+ const analytics = await getUsageAnalytics(365, scopeProfile)const value = Object.fromEntries((analytics.tools ?? []).map(e => [e.tool, e.count]))- // Only cache if the active profile hasn't changed during the request — else a- // switch mid-flight would file this result under the wrong profile's key.- if (normalizeProfileKey($activeGatewayProfile.get()) === key) {- toolCallsCache.set(key, { at: Date.now(), value })- }+ toolCallsCache.set(scopeKey, { at: Date.now(), value })return value}@@ -215,8 +213,8 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...pisError: skillsFailed,error: skillsError} = useQuery({- queryKey: SKILLS_QUERY_KEY,- queryFn: getSkills,+ queryKey: [...SKILLS_QUERY_KEY, scopeKey],+ queryFn: () => getSkills(scopeProfile),staleTime: 0})@@ -226,6 +224,14 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...pstaleTime: 0})+ // 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)@@ -249,15 +255,15 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...p// 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 switch landing before it resolves.+ // profile/scope switch landing before it resolves.if (toolCallsCache.size > 0) {const epoch = toolCallsEpoch.current- loadToolCalls(true)+ 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 })@@ -281,20 +287,24 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...pconst epoch = toolCallsEpoch.currentconst live = () => !cancelled && toolCallsEpoch.current === epoch- loadToolCalls()+ loadToolCalls(scopeKey, scopeProfile).then(value => live() && setToolCalls(value)).catch(() => live() && setToolCalls({}))return () => void (cancelled = true)- }, [mode, toolCalls])-- // On a profile switch the analytics cache is profile-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.+ }, [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 += 1setToolCalls(null)+ setScopeOverride(null)})const visibleSkills = useMemo(@@ -359,7 +369,7 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...psetSkills(current => current?.map(row => (row.name === skill.name ? { ...row, enabled } : row)) ?? current)try {- await setSkillEnabled(skill.name, enabled)+ 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()@@ -407,7 +417,7 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...ptry {for (const row of skillTargets) {- await setSkillEnabled(row.name, enabled)+ await setSkillEnabled(row.name, enabled, scopeProfile)setSkills(cur => cur?.map(r => (r.name === row.name ? { ...r, enabled } : r)) ?? cur)done += 1}@@ -509,7 +519,7 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...pconst epoch = skillEditorEpoch.currenttry {- const node = await getLearningNode(name)+ const node = await getLearningNode(name, scopeProfile)if (skillEditorEpoch.current !== epoch) {return@@ -530,7 +540,7 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...psetSkillSaving(true)try {- await editLearningNode(skillEditor.name, skillDraft)+ await editLearningNode(skillEditor.name, skillDraft, scopeProfile)notify({kind: 'success',title: t.skills.skillUpdated,@@ -567,14 +577,35 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...p</DetailPane>)- // Profile-scope selector, shown above the Tools and MCP tabs. Lets the user- // configure ANY profile's capabilities without switching the whole app.- // Only meaningful with >1 profile; hidden otherwise to avoid clutter.+ // 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.+ const changeScope = (value: string) => {+ if (value === (scopeProfile ?? '')) {+ return+ }++ setScopeOverride(value)+ toolCallsEpoch.current += 1+ setToolCalls(null)+ skillEditorEpoch.current += 1+ setSkillEditor(null)+ setSkillDraft('')+ setArchiveTarget(null)+ }++ // Profile-scope selector, shown above EVERY Capabilities tab (Skills, Tools,+ // MCP, Browse Hub). Lets the user configure ANY profile's capabilities+ // without switching the whole app. Only meaningful with >1 profile; hidden+ // otherwise to avoid clutter.const profileScopeSelector =profiles.length > 1 ? (<div className="flex items-center gap-2 border-b border-(--ui-stroke-secondary) px-3 py-2"><span className="text-[0.7rem] font-medium text-(--ui-text-tertiary)">{t.skills.configuringProfile}</span>- <Select onValueChange={value => setScopeOverride(value)} value={scopeProfile ?? ''}>+ <Select onValueChange={changeScope} value={scopeProfile ?? ''}><SelectTrigger className="h-7 w-56 text-xs"><SelectValue /></SelectTrigger>@@ -614,81 +645,85 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...p{ id: 'hub', label: t.skills.tabHub }]}>- {mode === 'hub' ? (- <SkillsHub query={query} />- ) : mode === 'mcp' ? (- <div className="flex h-full flex-col">- {profileScopeSelector}- <div className="min-h-0 flex-1">+ {/* One shared column: the scope selector sits above whichever tab is+ active, so Skills / Tools / MCP / Browse Hub all read and write the+ SAME selected profile. */}+ <div className="flex h-full flex-col">+ {profileScopeSelector}+ {/* One-click hub installs live right on the Skills tab: an embedded+ picker of the live Skills Hub (same postMessage trick Bot Mode+ uses), scoped to the selected profile. Collapsed by default. */}+ {mode === 'skills' && <EmbeddedHubPicker key={`picker-${scopeKey}`} profile={scopeProfile} />}+ <div className="min-h-0 flex-1">+ {mode === 'hub' ? (+ // Keyed per scope so a scope change remounts the hub (drops the+ // previous profile's action log / transient state).+ <SkillsHub key={`hub-${scopeKey}`} profile={scopeProfile} query={query} />+ ) : mode === 'mcp' ? (<McpTab gateway={gateway} key={`mcp-${scopeKey}`} profile={scopeProfile} />- </div>- </div>- ) : (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' ? (- visibleSkills.length === 0 ? (- capabilityEmpty('skills')- ) : (- <MasterDetail pane={skillEditorPane} 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)}+ ) : (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' ? (+ visibleSkills.length === 0 ? (+ capabilityEmpty('skills')+ ) : (+ <MasterDetail pane={skillEditorPane} 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={activeSkill?.name === skill.name}- busy={bulkBusy}- enabled={skill.enabled}- key={skill.name}- meta={usageOf(skill) > 0 ? `×${compactNumber(usageOf(skill))}` : undefined}- onSelect={() => setSelectedSkill(skill.name)}- onToggle={enabled => void handleToggleSkill(skill, enabled)}- subtitle={skillSubtitle(skill)}- title={skill.name}- toggleLabel={skill.name}- />- ))}- </ListColumn>- <DetailColumn footer={t.skills.changesApplyNewSessions}>- {activeSkill && (- <SkillDetail- onArchive={() => setArchiveTarget(activeSkill.name)}- onEdit={() => void openSkillEditor(activeSkill.name)}- skill={activeSkill}- />- )}- </DetailColumn>- </MasterDetail>- )- ) : visibleToolsets.length === 0 ? (- capabilityEmpty('tools')- ) : (- <div className="flex h-full flex-col">- {profileScopeSelector}- <div className="min-h-0 flex-1">+ >+ {visibleSkills.map(skill => (+ <CapRow+ active={activeSkill?.name === skill.name}+ busy={bulkBusy}+ enabled={skill.enabled}+ key={skill.name}+ meta={usageOf(skill) > 0 ? `×${compactNumber(usageOf(skill))}` : undefined}+ onSelect={() => setSelectedSkill(skill.name)}+ onToggle={enabled => void handleToggleSkill(skill, enabled)}+ subtitle={skillSubtitle(skill)}+ title={skill.name}+ toggleLabel={skill.name}+ />+ ))}+ </ListColumn>+ <DetailColumn footer={t.skills.changesApplyNewSessions}>+ {activeSkill && (+ <SkillDetail+ onArchive={() => setArchiveTarget(activeSkill.name)}+ onEdit={() => void openSkillEditor(activeSkill.name)}+ skill={activeSkill}+ />+ )}+ </DetailColumn>+ </MasterDetail>+ )+ ) : visibleToolsets.length === 0 ? (+ capabilityEmpty('tools')+ ) : (<MasterDetail split="wide"><ListColumnheader={@@ -737,9 +772,9 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...p)}</DetailColumn></MasterDetail>- </div>+ )}</div>- )}+ </div>{archiveTarget && (<ArchiveSkillConfirmDialogonApply={() => {@@ -753,11 +788,12 @@ export function SkillsView({ setStatusbarItemGroup: _setStatusbarItemGroup, ...psetSkillEditor(null)}- return () => setSkills(snapshot)+ return () => setSkills(() => snapshot)}}onClose={() => setArchiveTarget(null)}onFailure={(err, name) => notifyError(err, name)}open+ profile={scopeProfile}skillId={archiveTarget}skillName={archiveTarget}/>diff --git a/apps/desktop/src/hermes.ts b/apps/desktop/src/hermes.tsindex 30e1b9912fb..974a4da5a32 100644--- a/apps/desktop/src/hermes.ts+++ b/apps/desktop/src/hermes.ts@@ -1063,9 +1063,9 @@ export function getMemoryProviderOAuthStatus(provider: string): Promise<MemoryPr})}-export function getSkills(): Promise<SkillInfo[]> {+export function getSkills(profile?: null | string): Promise<SkillInfo[]> {return window.hermesDesktop.api<SkillInfo[]>({- ...profileScoped(),+ ...profileScoped(profile),path: '/api/skills'})}@@ -1086,25 +1086,29 @@ export interface LearningNodeDetail {ok: boolean}-export function getLearningNode(id: string): Promise<LearningNodeDetail> {+export function getLearningNode(id: string, profile?: null | string): Promise<LearningNodeDetail> {return window.hermesDesktop.api<LearningNodeDetail>({- ...profileScoped(),+ ...profileScoped(profile),path: `/api/learning/node?id=${encodeURIComponent(id)}`})}-export function deleteLearningNode(id: string): Promise<{ message: string; ok: boolean }> {+export function deleteLearningNode(id: string, profile?: null | string): Promise<{ message: string; ok: boolean }> {return window.hermesDesktop.api<{ message: string; ok: boolean }>({- ...profileScoped(),+ ...profileScoped(profile),path: '/api/learning/node',method: 'DELETE',body: { id }})}-export function editLearningNode(id: string, content: string): Promise<{ message: string; ok: boolean }> {+export function editLearningNode(+ id: string,+ content: string,+ profile?: null | string+): Promise<{ message: string; ok: boolean }> {return window.hermesDesktop.api<{ message: string; ok: boolean }>({- ...profileScoped(),+ ...profileScoped(profile),path: '/api/learning/node',method: 'PUT',body: { content, id }@@ -1113,10 +1117,11 @@ export function editLearningNode(id: string, content: string): Promise<{ messageexport function setSkillEnabled(name: string,- enabled: boolean+ enabled: boolean,+ profile?: null | string): Promise<{ ok: boolean; name: string; enabled: boolean }> {return window.hermesDesktop.api<{ ok: boolean; name: string; enabled: boolean }>({- ...profileScoped(),+ ...profileScoped(profile),path: '/api/skills/toggle',method: 'PUT',body: { name, enabled }@@ -1637,9 +1642,9 @@ export function importProfileArchive(})}-export function getUsageAnalytics(days = 30): Promise<AnalyticsResponse> {+export function getUsageAnalytics(days = 30, profile?: null | string): Promise<AnalyticsResponse> {return window.hermesDesktop.api<AnalyticsResponse>({- ...profileScoped(),+ ...profileScoped(profile),path: `/api/analytics/usage?days=${Math.max(1, Math.floor(days))}`})}@@ -1812,61 +1817,66 @@ export function getElevenLabsVoices(): Promise<ElevenLabsVoicesResponse> {const HUB_REQUEST_TIMEOUT_MS = 45_000-export function getSkillHubSources(): Promise<SkillHubSourcesResponse> {+export function getSkillHubSources(profile?: null | string): Promise<SkillHubSourcesResponse> {return window.hermesDesktop.api<SkillHubSourcesResponse>({- ...profileScoped(),+ ...profileScoped(profile),path: '/api/skills/hub/sources',timeoutMs: HUB_REQUEST_TIMEOUT_MS})}-export function searchSkillsHub(query: string, source = 'all', limit = 20): Promise<SkillHubSearchResponse> {+export function searchSkillsHub(+ query: string,+ source = 'all',+ limit = 20,+ profile?: null | string+): Promise<SkillHubSearchResponse> {const params = new URLSearchParams({ q: query, source, limit: String(limit) })return window.hermesDesktop.api<SkillHubSearchResponse>({- ...profileScoped(),+ ...profileScoped(profile),path: `/api/skills/hub/search?${params.toString()}`,timeoutMs: HUB_REQUEST_TIMEOUT_MS})}-export function previewSkillHub(identifier: string): Promise<SkillHubPreview> {+export function previewSkillHub(identifier: string, profile?: null | string): Promise<SkillHubPreview> {return window.hermesDesktop.api<SkillHubPreview>({- ...profileScoped(),+ ...profileScoped(profile),path: `/api/skills/hub/preview?identifier=${encodeURIComponent(identifier)}`,timeoutMs: HUB_REQUEST_TIMEOUT_MS})}-export function scanSkillHub(identifier: string): Promise<SkillHubScanResult> {+export function scanSkillHub(identifier: string, profile?: null | string): Promise<SkillHubScanResult> {return window.hermesDesktop.api<SkillHubScanResult>({- ...profileScoped(),+ ...profileScoped(profile),path: `/api/skills/hub/scan?identifier=${encodeURIComponent(identifier)}`,timeoutMs: HUB_REQUEST_TIMEOUT_MS})}-export function installSkillFromHub(identifier: string): Promise<ActionResponse> {+export function installSkillFromHub(identifier: string, profile?: null | string): Promise<ActionResponse> {return window.hermesDesktop.api<ActionResponse>({- ...profileScoped(),+ ...profileScoped(profile),path: '/api/skills/hub/install',method: 'POST',body: { identifier }})}-export function uninstallSkillFromHub(name: string): Promise<ActionResponse> {+export function uninstallSkillFromHub(name: string, profile?: null | string): Promise<ActionResponse> {return window.hermesDesktop.api<ActionResponse>({- ...profileScoped(),+ ...profileScoped(profile),path: '/api/skills/hub/uninstall',method: 'POST',body: { name }})}-export function updateSkillsFromHub(): Promise<ActionResponse> {+export function updateSkillsFromHub(profile?: null | string): Promise<ActionResponse> {return window.hermesDesktop.api<ActionResponse>({- ...profileScoped(),+ ...profileScoped(profile),path: '/api/skills/hub/update',method: 'POST',body: {}diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex 2aa80e8b689..e01c0994b0c 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -1171,6 +1171,10 @@ export const en: Translations = {updateStarted: 'Updating installed skills...',actionFailed: 'Skill action failed',actionLog: 'Action log',+ pickerTitle: 'Skills Hub',+ pickerBrowse: 'Browse the full hub',+ pickerHide: 'Hide the hub browser',+ pickerHint: 'Hit "+ Add to this Agent" on any skill — it installs and appears in the list above.',loadFailed: 'Skill hub failed to load',previewFailed: 'Skill preview failed',scanFailed: 'Security scan failed',diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.tsindex 86c28057f3c..0d24573ce9e 100644--- a/apps/desktop/src/i18n/types.ts+++ b/apps/desktop/src/i18n/types.ts@@ -1019,6 +1019,10 @@ export interface Translations {updateStarted: stringactionFailed: stringactionLog: string+ pickerTitle: string+ pickerBrowse: string+ pickerHide: string+ pickerHint: stringloadFailed: stringpreviewFailed: stringscanFailed: stringdiff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex 3f2641e62b6..196a73d49c4 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -1364,6 +1364,10 @@ export const zh: Translations = {updateStarted: '正在更新已安装技能…',actionFailed: '技能操作失败',actionLog: '操作日志',+ pickerTitle: '技能中心',+ pickerBrowse: '浏览完整技能中心',+ pickerHide: '隐藏技能中心浏览器',+ pickerHint: '点击任意技能上的“+ Add to this Agent”即可安装,安装后会出现在上方列表中。',loadFailed: '技能中心加载失败',previewFailed: '技能预览失败',scanFailed: '安全扫描失败',diff --git a/apps/desktop/src/store/hub-actions.ts b/apps/desktop/src/store/hub-actions.tsindex 4779060e7e9..6daf9ae35c1 100644--- a/apps/desktop/src/store/hub-actions.ts+++ b/apps/desktop/src/store/hub-actions.ts@@ -63,7 +63,15 @@ $activeGatewayProfile.subscribe(value => {// One self-contained task: spawn → tail its own action log into the store →// mark resolved. Concurrency-safe: state is per-key, so parallel installs never// stomp each other, and the sources query is invalidated once at the end.-async function runHubAction(key: string, kind: HubActionKind, spawn: () => Promise<{ name: string }>): Promise<void> {+// `profile` is the Capabilities profile-scope override — the action (and its+// status polling) runs against THAT profile's backend; undefined keeps the+// app-wide active profile (unchanged behavior).+async function runHubAction(+ key: string,+ kind: HubActionKind,+ spawn: () => Promise<{ name: string }>,+ profile?: null | string+): Promise<void> {const epoch = _hubEpochconst switched = () => _hubEpoch !== epoch@@ -75,7 +83,7 @@ async function runHubAction(key: string, kind: HubActionKind, spawn: () => Promilet exitCode: number | null = nullfor (;;) {- const status = await getActionStatus(started.name, 200)+ const status = await getActionStatus(started.name, 200, profile)// Profile switched mid-flight: the store was cleared for the new profile,// so drop this A-profile result instead of writing it back into B.@@ -129,16 +137,16 @@ async function runHubAction(key: string, kind: HubActionKind, spawn: () => Promi}}-export function installHubSkill(identifier: string): Promise<void> {- return runHubAction(identifier, 'install', () => installSkillFromHub(identifier))+export function installHubSkill(identifier: string, profile?: null | string): Promise<void> {+ return runHubAction(identifier, 'install', () => installSkillFromHub(identifier, profile), profile)}-export function uninstallHubSkill(identifier: string, name: string): Promise<void> {- return runHubAction(identifier, 'uninstall', () => uninstallSkillFromHub(name))+export function uninstallHubSkill(identifier: string, name: string, profile?: null | string): Promise<void> {+ return runHubAction(identifier, 'uninstall', () => uninstallSkillFromHub(name, profile), profile)}-export function updateHubSkills(): Promise<void> {- return runHubAction(UPDATE_ALL_KEY, 'update', () => updateSkillsFromHub())+export function updateHubSkills(profile?: null | string): Promise<void> {+ return runHubAction(UPDATE_ALL_KEY, 'update', () => updateSkillsFromHub(profile), profile)}export function closeHubLog(): void {