mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-27 11:22:03 +00:00
Merge pull request #52206 from NousResearch/bb/desktop-tools-curation
fix(desktop): hide platform/internal toolsets from the Skills & Tools list
This commit is contained in:
commit
55af6c447a
3 changed files with 46 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ import { Switch } from '@/components/ui/switch'
|
|||
import { TextTab, TextTabMeta } from '@/components/ui/text-tab'
|
||||
import { getSkills, getToolsets, toggleSkill, toggleToolset } from '@/hermes'
|
||||
import { useI18n } from '@/i18n'
|
||||
import { isDesktopToolsetVisible } from '@/lib/desktop-toolsets'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { notify, notifyError } from '@/store/notifications'
|
||||
import type { SkillInfo, ToolsetInfo } from '@/types/hermes'
|
||||
|
|
@ -52,6 +53,10 @@ function filteredToolsets(toolsets: ToolsetInfo[], query: string): ToolsetInfo[]
|
|||
|
||||
return toolsets
|
||||
.filter(toolset => {
|
||||
if (!isDesktopToolsetVisible(toolset.name)) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!q) {
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
17
apps/desktop/src/lib/desktop-toolsets.test.ts
Normal file
17
apps/desktop/src/lib/desktop-toolsets.test.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { isDesktopToolsetVisible } from './desktop-toolsets'
|
||||
|
||||
describe('isDesktopToolsetVisible', () => {
|
||||
it('hides platform-coupled and internal toolsets', () => {
|
||||
for (const name of ['discord', 'discord_admin', 'yuanbao', 'context_engine', 'moa']) {
|
||||
expect(isDesktopToolsetVisible(name)).toBe(false)
|
||||
}
|
||||
})
|
||||
|
||||
it('keeps ordinary user-facing toolsets', () => {
|
||||
for (const name of ['web', 'browser', 'terminal', 'file', 'memory', 'vision', 'image_gen']) {
|
||||
expect(isDesktopToolsetVisible(name)).toBe(true)
|
||||
}
|
||||
})
|
||||
})
|
||||
24
apps/desktop/src/lib/desktop-toolsets.ts
Normal file
24
apps/desktop/src/lib/desktop-toolsets.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Curation for the desktop "Skills & Tools → Toolsets" list.
|
||||
//
|
||||
// `GET /api/tools/toolsets` returns the full CONFIGURABLE_TOOLSETS set with no
|
||||
// desktop-specific filter — so it surfaces entries that don't belong in a flat
|
||||
// per-user toggle list on the desktop: platform-coupled toolsets (which
|
||||
// `hermes tools` already platform-restricts on the CLI) and internal plumbing
|
||||
// that isn't a user-facing capability. Mirror the curation approach used for
|
||||
// slash commands (`desktop-slash-commands.ts`): one documented block-list, one
|
||||
// predicate. Hiding a toolset only removes its row — its enabled state and
|
||||
// runtime gating are untouched.
|
||||
const DESKTOP_HIDDEN_TOOLSETS = new Set([
|
||||
// Platform-coupled — only meaningful when that platform is the active
|
||||
// adapter; `hermes tools` restricts these off the CLI too.
|
||||
'discord',
|
||||
'discord_admin',
|
||||
'yuanbao',
|
||||
// Internal plumbing, not a user capability toggle.
|
||||
'context_engine',
|
||||
'moa'
|
||||
])
|
||||
|
||||
export function isDesktopToolsetVisible(name: string): boolean {
|
||||
return !DESKTOP_HIDDEN_TOOLSETS.has(name)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue