Skip to content

The agent that grows with you

simplify(desktop): one plugin install dialog: name, one line, Install

alt-glitch4228fe649a54
diff --git a/apps/desktop/src/app/settings/plugin-install-details.tsx b/apps/desktop/src/app/settings/plugin-install-details.tsx
new file mode 100644
index 00000000000..d26d2c69ac2
--- /dev/null
+++ b/apps/desktop/src/app/settings/plugin-install-details.tsx
@@ -0,0 +1,186 @@
+import type { ReactNode } from 'react'
+
+import { Input } from '@/components/ui/input'
+import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
+import { Switch } from '@/components/ui/switch'
+import { ExternalLink } from '@/lib/external-link'
+import { resolvePluginSourceLinks } from '@/lib/plugin-source-urls'
+import { cn } from '@/lib/utils'
+import type { PluginInstallRequest } from '@/store/plugin-install-request'
+import { normalizeProfileKey, profileLabel } from '@/store/profile'
+import type { ProfileInfo } from '@/types/hermes'
+
+import {
+ desktopHalfFromPackage,
+ installComponents,
+ type InstallModalCopy,
+ type ProbeResult
+} from './plugin-install-run'
+
+const CAPTION = 'text-[length:var(--conversation-caption-font-size)]'
+
+export interface PinState {
+ value: string
+ invalid: boolean
+ onChange: (value: string) => void
+}
+
+export interface ProfileState {
+ value: string
+ label: string
+ options: Pick<ProfileInfo, 'display_name' | 'name'>[]
+ onChange: (value: string) => void
+}
+
+interface PluginInstallDetailsProps {
+ copy: InstallModalCopy
+ request: PluginInstallRequest
+ probe: null | ProbeResult
+ remote: boolean
+ busy: boolean
+ profile: ProfileState
+ pin: PinState
+ force: boolean
+ onForceChange: (value: boolean) => void
+}
+
+function Row({ label, children }: { label: string; children: ReactNode }) {
+ return (
+ <div className="grid gap-1">
+ <dt className={cn(CAPTION, 'text-(--ui-text-tertiary)')}>{label}</dt>
+ <dd className={cn(CAPTION, 'min-w-0 text-foreground')}>{children}</dd>
+ </div>
+ )
+}
+
+function SourceRow({ copy, repo }: { copy: InstallModalCopy; repo: string }) {
+ const links = resolvePluginSourceLinks(repo)
+
+ return (
+ <Row label={copy.sourceHeading}>
+ <span className="block font-mono break-all">{repo}</span>
+ {links?.browseUrl && (
+ <ExternalLink href={links.browseUrl} showExternalIcon>
+ {links.subdir ? copy.viewPluginFiles : copy.viewRepository}
+ </ExternalLink>
+ )}
+ </Row>
+ )
+}
+
+function VersionRow({
+ copy,
+ request,
+ pin,
+ agent,
+ busy
+}: Pick<PluginInstallDetailsProps, 'busy' | 'copy' | 'pin' | 'request'> & { agent: boolean }) {
+ if (request.catalogName) {
+ return <Row label={copy.versionLabel}>{copy.reviewedPin(request.sha?.slice(0, 8) ?? '')}</Row>
+ }
+
+ if (!agent) {
+ return <Row label={copy.versionLabel}>{copy.latestCommit}</Row>
+ }
+
+ return (
+ <Row label={copy.pinToCommit}>
+ <Input
+ aria-invalid={pin.invalid || undefined}
+ aria-label={copy.pinToCommit}
+ disabled={busy}
+ onChange={event => pin.onChange(event.target.value)}
+ placeholder={copy.pinToCommitPlaceholder}
+ spellCheck={false}
+ value={pin.value}
+ />
+ <span className={cn('mt-1 block', pin.invalid ? 'text-destructive' : 'text-(--ui-text-tertiary)')}>
+ {pin.invalid ? copy.pinToCommitInvalid : copy.pinToCommitHint}
+ </span>
+ </Row>
+ )
+}
+
+function ContentsRow({
+ copy,
+ request,
+ probe,
+ remote,
+ profile
+}: Pick<PluginInstallDetailsProps, 'copy' | 'probe' | 'profile' | 'remote' | 'request'>) {
+ if (!probe?.ok) {
+ return <Row label={copy.includesHeading}>{probe ? '' : copy.probing}</Row>
+ }
+
+ const components = installComponents(request, probe)
+ const fromPackage = desktopHalfFromPackage(components, remote)
+
+ const agentTarget = remote
+ ? copy.agentTargetRemote(profile.label)
+ : copy.agentTargetLocal(
+ profile.label,
+ profile.value === 'default' ? '~/.hermes/plugins/' : `~/.hermes/profiles/${profile.value}/plugins/`
+ )
+
+ const lines = [
+ components.agent && {
+ title: [copy.agentLabel, probe.agentName].filter(Boolean).join(' · '),
+ hint: agentTarget
+ },
+ components.desktop && {
+ title: [copy.desktopLabel, fromPackage ? null : probe.desktopName].filter(Boolean).join(' · '),
+ hint: fromPackage ? copy.desktopTargetFromPackage : copy.desktopTarget
+ }
+ ].filter(line => line !== false)
+
+ return (
+ <Row label={copy.includesHeading}>
+ <ul className="grid gap-1.5">
+ {lines.map(line => (
+ <li key={line.title}>
+ <span className="block font-medium">{line.title}</span>
+ <span className="block text-(--ui-text-tertiary)">{line.hint}</span>
+ </li>
+ ))}
+ </ul>
+ {probe.desktop && !probe.agent && <p className="mt-1 text-(--ui-text-tertiary)">{copy.desktopOnlyNote}</p>}
+ </Row>
+ )
+}
+
+/** The install's particulars behind Advanced: where it comes from, which version, what it puts down, and
+ * the profile it lands in. A git URL that is not in the reviewed catalog also offers Force and a pin. */
+export function PluginInstallDetails(props: PluginInstallDetailsProps) {
+ const { busy, copy, force, onForceChange, probe, profile, request } = props
+ const agent = !probe?.ok || installComponents(request, probe).agent
+
+ return (
+ <dl className="grid gap-3 rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) px-3 py-2.5">
+ <SourceRow copy={copy} repo={request.repo} />
+ <VersionRow agent={agent} busy={busy} copy={copy} pin={props.pin} request={request} />
+ <ContentsRow copy={copy} probe={probe} profile={profile} remote={props.remote} request={request} />
+ <Row label={copy.profileLabel}>
+ <Select disabled={busy || !agent} onValueChange={profile.onChange} value={profile.value}>
+ <SelectTrigger aria-label={copy.profileLabel} className="w-full">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {profile.options.map(option => (
+ <SelectItem key={option.name} value={normalizeProfileKey(option.name)}>
+ {profileLabel(option)}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </Row>
+ {!request.catalogName && (
+ <div>
+ <label className={cn(CAPTION, 'flex items-center justify-between gap-3 text-foreground')}>
+ <span>{copy.forceReinstall}</span>
+ <Switch checked={force} disabled={busy} onCheckedChange={onForceChange} />
+ </label>
+ </div>
+ )}
+ </dl>
+ )
+}
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 6d37ae782d4..44721568e7d 100644
--- a/apps/desktop/src/app/settings/plugin-install-modal.test.tsx
+++ b/apps/desktop/src/app/settings/plugin-install-modal.test.tsx
@@ -1,5 +1,5 @@
import { QueryClientProvider } from '@tanstack/react-query'
-import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'
import { MemoryRouter } from 'react-router'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
@@ -35,6 +35,26 @@ import { PluginInstallModal } from './plugin-install-modal'
const probePluginRepo = vi.fn()
const installDesktopPlugin = vi.fn()
+const BLENDER = {
+ catalogName: 'blender',
+ repo: 'https://github.com/NousResearch/hermes-official-plugins#blender',
+ sha: 'abec9e822a23089943dd1d476a104bf746f19f86',
+ summary: 'Build and render 3D scenes in your Blender.',
+ title: 'Blender'
+}
+
+const installCalls = () =>
+ requestGateway.mock.calls.filter(([method, params]) => method === 'plugins.manage' && params?.action === 'install')
+
+const installButton = () => screen.getByRole('button', { name: /^Install/ }) as HTMLButtonElement
+
+const deferred = <T,>() => {
+ let resolve!: (value: T) => void
+ const promise = new Promise<T>(done => (resolve = done))
+
+ return { promise, resolve }
+}
+
const renderFlow = () =>
render(
<MemoryRouter initialEntries={['/capabilities?tab=plugins']}>
@@ -51,6 +71,7 @@ beforeEach(() => {
queryClient.clear()
closePluginInstallRequest()
$gatewayState.set('idle')
+ $connection.set({ mode: 'local' } as NonNullable<ReturnType<typeof $connection.get>>)
$activeGatewayProfile.set('default')
$profiles.set([
{
@@ -73,7 +94,8 @@ beforeEach(() => {
skill_count: 0
}
])
- probePluginRepo.mockResolvedValue({ ok: true, agent: true, desktop: true, warnings: [] })
+ requestGateway.mockImplementation(async () => ({ plugins: [] }))
+ probePluginRepo.mockResolvedValue({ ok: true, agent: true, agentName: 'blender', desktop: false, warnings: [] })
vi.stubGlobal('hermesDesktop', { probePluginRepo, installDesktopPlugin })
})
afterEach(() => {
@@ -82,11 +104,118 @@ afterEach(() => {
vi.unstubAllGlobals()
})
-describe('Install from Git entry flow', () => {
+describe('A reviewed catalog pick', () => {
+ it('shows only name, one line and Verified until Advanced reveals source, version and profile', async () => {
+ renderFlow()
+ act(() => openPluginInstallRequest(BLENDER))
+
+ const dialog = await screen.findByRole('dialog', { name: 'Blender' })
+ expect(within(dialog).getByText('Verified')).toBeTruthy()
+ expect(within(dialog).getByText(BLENDER.summary)).toBeTruthy()
+ expect(within(dialog).getByText('Reviewed by Nous. Installs for default and turns on right away.')).toBeTruthy()
+ expect(within(dialog).queryByText(BLENDER.repo)).toBeNull()
+ expect(within(dialog).queryByRole('combobox')).toBeNull()
+ expect(within(dialog).queryByRole('checkbox')).toBeNull()
+ expect(within(dialog).queryByRole('switch')).toBeNull()
+
+ fireEvent.click(within(dialog).getByRole('button', { name: 'Advanced' }))
+
+ expect(within(dialog).getByText(BLENDER.repo)).toBeTruthy()
+ expect(within(dialog).getByText('Reviewed pin abec9e82')).toBeTruthy()
+ expect(await within(dialog).findByText('Agent plugin · blender')).toBeTruthy()
+ expect(within(dialog).getByRole('combobox', { name: 'Install for profile' })).toBeTruthy()
+ // Contents are read-only: the package decides its halves, not a checklist.
+ expect(within(dialog).queryByRole('checkbox')).toBeNull()
+ })
+
+ it('shows one loader, installs once with enable on, then closes', async () => {
+ const reply = deferred<unknown>()
+ requestGateway.mockImplementation(async (method, params) =>
+ method === 'plugins.manage' && params?.action === 'install' ? reply.promise : { plugins: [] }
+ )
+ renderFlow()
+ act(() => openPluginInstallRequest(BLENDER))
+ await waitFor(() => expect(probePluginRepo).toHaveBeenCalled())
+
+ fireEvent.click(installButton())
+
+ await waitFor(() => expect(installButton().textContent).toBe('Installing…'))
+ expect(installButton().disabled).toBe(true)
+ expect((screen.getByRole('button', { name: 'Cancel' }) as HTMLButtonElement).disabled).toBe(true)
+ fireEvent.click(installButton())
+ reply.resolve({ ok: true, plugin_name: 'blender', enabled: true })
+
+ await waitFor(() => expect($pluginInstallRequest.get()).toBeNull())
+ expect(installCalls()).toHaveLength(1)
+ expect(installCalls()[0]?.[1]).toMatchObject({ catalog_name: 'blender', enable: true, force: false })
+ })
+
+ it('waits under the loader for an inspection still running, then installs once', async () => {
+ const probe = deferred<unknown>()
+ probePluginRepo.mockReturnValue(probe.promise)
+ requestGateway.mockImplementation(async (method, params) =>
+ method === 'plugins.manage' && params?.action === 'install'
+ ? { ok: true, plugin_name: 'blender' }
+ : { plugins: [] }
+ )
+ renderFlow()
+ act(() => openPluginInstallRequest(BLENDER))
+ await screen.findByRole('dialog', { name: 'Blender' })
+
+ fireEvent.click(installButton())
+ await waitFor(() => expect(installButton().textContent).toBe('Installing…'))
+ expect(installCalls()).toHaveLength(0)
+
+ probe.resolve({ ok: true, agent: true, agentName: 'blender', desktop: false, warnings: [] })
+
+ await waitFor(() => expect($pluginInstallRequest.get()).toBeNull())
+ expect(installCalls()).toHaveLength(1)
+ })
+
+ it('installs into the profile picked under Advanced', async () => {
+ requestGateway.mockImplementation(async (method, params) =>
+ method === 'plugins.manage' && params?.action === 'install'
+ ? { ok: true, plugin_name: 'blender' }
+ : { plugins: [] }
+ )
+ renderFlow()
+ act(() => openPluginInstallRequest(BLENDER))
+ fireEvent.click(await screen.findByRole('button', { name: 'Advanced' }))
+ fireEvent.click(screen.getByRole('combobox', { name: 'Install for profile' }))
+ fireEvent.click(await screen.findByRole('option', { name: 'Research Bot' }))
+
+ expect(screen.getByText('Reviewed by Nous. Installs for Research Bot and turns on right away.')).toBeTruthy()
+ fireEvent.click(installButton())
+
+ await waitFor(() => expect(installCalls()[0]?.[1]).toMatchObject({ catalog_name: 'blender', profile: 'research' }))
+ })
+
+ it('states a failure in one line and retries the install', async () => {
+ requestGateway.mockImplementation(async (method, params) =>
+ method === 'plugins.manage' && params?.action === 'install'
+ ? { ok: false, error: 'Blender was not found on this computer.' }
+ : { plugins: [] }
+ )
+ renderFlow()
+ act(() => openPluginInstallRequest(BLENDER))
+ await waitFor(() => expect(probePluginRepo).toHaveBeenCalled())
+ fireEvent.click(installButton())
+
+ expect((await screen.findByRole('alert')).textContent).toBe('Blender was not found on this computer.')
+ expect($pluginInstallRequest.get()).not.toBeNull()
+
+ fireEvent.click(screen.getByRole('button', { name: 'Retry' }))
+
+ await waitFor(() => expect(installCalls()).toHaveLength(2))
+ })
+})
+
+describe('A raw git URL', () => {
it.each(['local', 'remote'] as const)(
- 'opens repository entry and reviews without installing in %s mode',
+ 'opens repository entry, then the same dialog marked Unverified with its details open (%s)',
async mode => {
$connection.set({ mode } as NonNullable<ReturnType<typeof $connection.get>>)
+ probePluginRepo.mockResolvedValue({ ok: true, agent: true, agentName: 'plugin', desktop: false, warnings: [] })
renderFlow()
fireEvent.click(screen.getByRole('button', { name: 'Install from Git' }))
const input = await screen.findByRole('textbox', { name: 'Repository' })
@@ -100,8 +229,13 @@ describe('Install from Git entry flow', () => {
await waitFor(() =>
expect(probePluginRepo).toHaveBeenCalledWith({ identifier: 'https://github.com/example/plugin' })
)
- expect(await screen.findByText('This package includes')).toBeTruthy()
- expect(requestGateway).not.toHaveBeenCalledWith('plugins.manage', expect.objectContaining({ action: 'install' }))
+
+ const dialog = await screen.findByRole('dialog', { name: 'plugin' })
+ expect(within(dialog).getByText('Unverified')).toBeTruthy()
+ expect(within(dialog).getByRole('button', { name: 'Advanced' }).getAttribute('aria-expanded')).toBe('true')
+ expect(within(dialog).getByText('https://github.com/example/plugin')).toBeTruthy()
+ expect(within(dialog).getByText('This package includes')).toBeTruthy()
+ expect(installCalls()).toHaveLength(0)
expect(installDesktopPlugin).not.toHaveBeenCalled()
fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
expect($pluginInstallRequest.get()).toBeNull()
@@ -120,63 +254,50 @@ describe('Install from Git entry flow', () => {
expect(installDesktopPlugin).not.toHaveBeenCalled()
})
- it('preserves prefilled deep-link inspection and legacy selection without auto-install', async () => {
+ it('installs only once its contents are on screen, and keeps the security warning in view', async () => {
+ const probe = deferred<unknown>()
+ probePluginRepo.mockReturnValue(probe.promise)
+ renderFlow()
+ act(() => openPluginInstallRequest({ repo: 'http://example.test/plugin' }))
+ await screen.findByText('Inspecting repository…')
+ expect(installButton().disabled).toBe(true)
+
+ probe.resolve({ ok: true, agent: true, agentName: 'plugin', desktop: false, warnings: [], insecure: true })
+
+ await waitFor(() => expect(installButton().disabled).toBe(false))
+ expect(screen.getByText(/insecure or local scheme/)).toBeTruthy()
+ fireEvent.click(screen.getByRole('button', { name: 'Advanced' }))
+ expect(screen.getByText(/insecure or local scheme/)).toBeTruthy()
+ })
+
+ it('keeps a legacy deep link to the half it names, read-only and without auto-install', async () => {
+ probePluginRepo.mockResolvedValue({ ok: true, agent: true, agentName: 'plugin', desktop: true, warnings: [] })
renderFlow()
act(() => openPluginInstallRequest({ repo: 'https://github.com/example/plugin', legacyHint: 'desktop' }))
- expect(await screen.findByText('This package includes')).toBeTruthy()
+ expect(await screen.findByText(/^Desktop UI/)).toBeTruthy()
+ expect(screen.queryByText(/^Agent plugin/)).toBeNull()
+ expect(screen.queryByRole('checkbox')).toBeNull()
expect(screen.queryByRole('textbox', { name: 'Repository' })).toBeNull()
- const boxes = screen.getAllByRole('checkbox')
- expect(boxes.map(box => box.getAttribute('aria-checked'))).toEqual(['false', 'true'])
expect(probePluginRepo).toHaveBeenCalledTimes(1)
- expect(requestGateway).not.toHaveBeenCalledWith('plugins.manage', expect.objectContaining({ action: 'install' }))
+ expect(installCalls()).toHaveLength(0)
expect(installDesktopPlugin).not.toHaveBeenCalled()
})
- it('installs a deep-linked agent plugin into the selected profile', async () => {
- probePluginRepo.mockResolvedValue({ ok: true, agent: true, desktop: false, warnings: [] })
- requestGateway.mockImplementation(async method =>
- method === 'plugins.manage' ? { ok: true, plugin_name: 'plugin', plugins: [] } : { plugins: [] }
- )
- renderFlow()
- act(() => openPluginInstallRequest({ catalogName: 'plugin', repo: 'https://github.com/example/plugin' }))
-
- const profile = await screen.findByRole('combobox', { name: 'Install for profile' })
-
- fireEvent.click(profile)
- fireEvent.click(await screen.findByRole('option', { name: 'Research Bot' }))
- fireEvent.click(screen.getByRole('button', { name: 'Install' }))
-
- await waitFor(() =>
- expect(requestGateway).toHaveBeenCalledWith(
- 'plugins.manage',
- expect.objectContaining({ action: 'install', catalog_name: 'plugin', profile: 'research' }),
- expect.any(Number)
- )
- )
- })
-
it('pins a custom install to a full commit SHA and refuses anything shorter', async () => {
- probePluginRepo.mockResolvedValue({ ok: true, agent: true, desktop: false, warnings: [] })
requestGateway.mockImplementation(async method =>
method === 'plugins.manage' ? { ok: true, plugin_name: 'plugin', plugins: [] } : { plugins: [] }
)
renderFlow()
act(() => openPluginInstallRequest({ repo: 'https://github.com/example/plugin' }))
const pin = await screen.findByRole('textbox', { name: 'Pin to commit (optional)' })
- const install = screen.getByRole('button', { name: 'Install' }) as HTMLButtonElement
+ await waitFor(() => expect(installButton().disabled).toBe(false))
fireEvent.change(pin, { target: { value: 'main' } })
- expect(install.disabled).toBe(true)
+ expect(installButton().disabled).toBe(true)
const sha = 'ABCDEF0123456789abcdef0123456789abcdef01'
fireEvent.change(pin, { target: { value: ` ${sha} ` } })
- expect(install.disabled).toBe(false)
- fireEvent.click(install)
- await waitFor(() =>
- expect(requestGateway).toHaveBeenCalledWith(
- 'plugins.manage',
- expect.objectContaining({ action: 'install', ref: sha.toLowerCase() }),
- expect.any(Number)
- )
- )
+ expect(installButton().disabled).toBe(false)
+ fireEvent.click(installButton())
+ await waitFor(() => expect(installCalls()[0]?.[1]).toMatchObject({ enable: true, ref: sha.toLowerCase() }))
})
})
@@ -197,14 +318,9 @@ describe('Unified package desktop half on a local backend', () => {
renderFlow()
act(() => openPluginInstallRequest({ repo: 'https://github.com/example/pkg' }))
expect(await screen.findByText('This package includes')).toBeTruthy()
- fireEvent.click(screen.getByRole('button', { name: 'Install' }))
- await waitFor(() =>
- expect(requestGateway).toHaveBeenCalledWith(
- 'plugins.manage',
- expect.objectContaining({ action: 'install' }),
- expect.any(Number)
- )
- )
+ await waitFor(() => expect(installButton().disabled).toBe(false))
+ fireEvent.click(installButton())
+ await waitFor(() => expect(installCalls()).toHaveLength(1))
expect(await screen.findByText(alreadyExists)).toBeTruthy()
}
@@ -228,10 +344,8 @@ describe('Unified package desktop half on a local backend', () => {
expect(reconcileDesktopPlugins).not.toHaveBeenCalled()
})
- it('turns the desktop half on with the agent half: one "Enable after install" covers the package', async () => {
- // The half lands opt-in (marker => defaultEnabled false). Before, the
- // dialog enabled only the agent half and the Desktop switch stayed off.
- $connection.set({ mode: 'local' } as NonNullable<ReturnType<typeof $connection.get>>)
+ it('turns the desktop half on with the agent half: install means ready for the whole package', async () => {
+ // The half lands opt-in (marker => defaultEnabled false); the install turns it on with the agent half.
probePluginRepo.mockResolvedValue({ ok: true, agent: true, agentName: 'pkg', desktop: true, warnings: [] })
requestGateway.mockImplementation(async (method, params) =>
method === 'plugins.manage' && params?.action === 'install'
@@ -250,7 +364,8 @@ describe('Unified package desktop half on a local backend', () => {
renderFlow()
act(() => openPluginInstallRequest({ repo: 'https://github.com/example/pkg' }))
expect(await screen.findByText('This package includes')).toBeTruthy()
- fireEvent.click(screen.getByRole('button', { name: 'Install' }))
+ await waitFor(() => expect(installButton().disabled).toBe(false))
+ fireEvent.click(installButton())
await waitFor(() => expect($pluginRecords.get()['pkg-ui']?.status).toBe('loaded'))
expect($pluginDecisions.get()['pkg-ui']).toBe(true)
@@ -260,6 +375,7 @@ describe('Unified package desktop half on a local backend', () => {
it('does not start the desktop half or offer a retry when the agent install outcome is unknown', async () => {
$connection.set({ mode: 'remote' } as NonNullable<ReturnType<typeof $connection.get>>)
+ probePluginRepo.mockResolvedValue({ ok: true, agent: true, agentName: 'pkg', desktop: true, warnings: [] })
requestGateway.mockImplementation(async (method, params) => {
if (method === 'plugins.manage' && params?.action === 'install') {
throw new Error('request timed out after 120s: plugins.manage')
@@ -270,11 +386,13 @@ describe('Unified package desktop half on a local backend', () => {
renderFlow()
act(() => openPluginInstallRequest({ repo: 'https://github.com/example/pkg' }))
expect(await screen.findByText('This package includes')).toBeTruthy()
- fireEvent.click(screen.getByRole('button', { name: 'Install' }))
+ await waitFor(() => expect(installButton().disabled).toBe(false))
+ fireEvent.click(installButton())
const status = await screen.findByRole('status')
expect(status.textContent).toContain('may still be installing')
expect(installDesktopPlugin).not.toHaveBeenCalled()
- expect((screen.getByRole('button', { name: 'Install' }) as HTMLButtonElement).disabled).toBe(true)
+ expect(screen.queryByRole('button', { name: 'Retry' })).toBeNull()
+ expect(installButton().disabled).toBe(true)
})
})
diff --git a/apps/desktop/src/app/settings/plugin-install-modal.tsx b/apps/desktop/src/app/settings/plugin-install-modal.tsx
index f13ad95fba6..ffd91018de5 100644
--- a/apps/desktop/src/app/settings/plugin-install-modal.tsx
+++ b/apps/desktop/src/app/settings/plugin-install-modal.tsx
@@ -1,11 +1,12 @@
import { useStore } from '@nanostores/react'
-import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import { Puzzle } from 'lucide-react'
+import { type ReactNode, useEffect, useState } from 'react'
import { useLocation, useNavigate } from 'react-router'
import { useGatewayRequest } from '@/app/gateway/hooks/use-gateway-request'
import { NEW_CHAT_ROUTE, SETTINGS_ROUTE } from '@/app/routes'
+import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
-import { Checkbox } from '@/components/ui/checkbox'
import {
Dialog,
DialogContent,
@@ -15,23 +16,12 @@ import {
DialogTitle,
preventCloseButtonAutoFocus
} from '@/components/ui/dialog'
+import { DisclosureCaret } from '@/components/ui/disclosure-caret'
import { Input } from '@/components/ui/input'
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
-import { Switch } from '@/components/ui/switch'
-import { enablePackageDesktopHalf } from '@/contrib/plugins-store'
-import { discoverRuntimePlugins } from '@/contrib/runtime-loader'
import { useI18n } from '@/i18n'
-import { ExternalLink } from '@/lib/external-link'
-import { AlertTriangle } from '@/lib/icons'
-import { resolvePluginSourceLinks } from '@/lib/plugin-source-urls'
-import {
- type AgentPluginInstallResult,
- type AgentPluginLiveNow,
- COMMIT_SHA_RE,
- installAgentPlugin,
- loadAgentPlugins
-} from '@/store/agent-plugins'
-import { notify } from '@/store/notifications'
+import { AlertTriangle, Loader2 } from '@/lib/icons'
+import { cn } from '@/lib/utils'
+import { COMMIT_SHA_RE } from '@/store/agent-plugins'
import {
$pluginInstallRequest,
closePluginInstallRequest,
@@ -41,32 +31,11 @@ import {
import { $activeGatewayProfile, $profiles, $profileScope, normalizeProfileKey, profileLabel } from '@/store/profile'
import { $connection } from '@/store/session'
-type ProbeResult = Awaited<ReturnType<NonNullable<NonNullable<Window['hermesDesktop']>['probePluginRepo']>>>
-
-type ProbePhase = 'idle' | 'probing' | 'ready' | 'error'
-
-type InstallModalCopy = ReturnType<typeof useI18n>['t']['settings']['plugins']['installModal']
+import { PluginInstallDetails } from './plugin-install-details'
+import { type InstallModalCopy, type ProbeResult, runPluginInstall } from './plugin-install-run'
+import { usePluginProbe } from './use-plugin-probe'
-/** What an agent-plugin install made usable, as toast fragments ("12 tools connected", ...). */
-function installOutcome(m: InstallModalCopy, live: AgentPluginLiveNow, nextChat: boolean): string[] {
- const tools = live.mcpServers.reduce((n, server) => n + (server.connected ? server.tools.length : 0), 0)
-
- return [
- ...(tools > 0 ? [m.toolsConnected(tools)] : []),
- ...(live.skills.length > 0 ? [m.skillsReady(live.skills)] : []),
- ...(nextChat ? [m.nextChat] : [])
- ]
-}
-
-/** One "Enable after install" covers both halves of a unified package: its
- * desktop half lands opt-in (it matches an inert agent half), so an install
- * that enabled the agent half turns the desktop half on too. Before, the
- * user had to find and flip the row's Desktop switch afterwards. */
-async function enableInstalledDesktopHalf(result?: AgentPluginInstallResult): Promise<void> {
- if (result?.enabled && result.pluginName) {
- await enablePackageDesktopHalf(result.pluginName)
- }
-}
+const CAPTION = 'text-[length:var(--conversation-caption-font-size)]'
/** Close the dialog and land on the inventory (Capabilities → Plugins), unless the caller keeps the user in place. */
function finishInstall(request: PluginInstallRequest, navigate: (to: string) => void): void {
@@ -77,110 +46,105 @@ function finishInstall(request: PluginInstallRequest, navigate: (to: string) =>
}
}
-export function PluginInstallModal() {
- const request = useStore($pluginInstallRequest)
- const { t } = useI18n()
- const m = t.settings.plugins.installModal
- const { requestGateway } = useGatewayRequest()
- const navigate = useNavigate()
- const location = useLocation()
- const onSettings = location.pathname.startsWith(SETTINGS_ROUTE)
- const connection = useStore($connection)
- const activeProfile = useStore($activeGatewayProfile)
- const profiles = useStore($profiles)
- const profileScope = useStore($profileScope)
+/** `owner/repo#sub/dir` → `dir`; `https://host/owner/repo.git` → `repo`. */
+function repoName(repo: string): string {
+ const [base, subdir] = repo.split('#')
- const [repoInput, setRepoInput] = useState('')
- const [targetProfile, setTargetProfile] = useState('default')
- const [phase, setPhase] = useState<ProbePhase>('idle')
- const [probe, setProbe] = useState<ProbeResult | null>(null)
- const [installAgent, setInstallAgent] = useState(true)
- const [installDesktop, setInstallDesktop] = useState(true)
- const [enableAgent, setEnableAgent] = useState(true)
- const [forceReinstall, setForceReinstall] = useState(false)
- const [pinRef, setPinRef] = useState('')
- const [installing, setInstalling] = useState(false)
- const [installError, setInstallError] = useState<string | null>(null)
- const [installUncertain, setInstallUncertain] = useState(false)
- const probeToken = useRef(0)
-
- const resetState = useCallback(() => {
- setRepoInput('')
- setPhase('idle')
- setProbe(null)
- setInstallAgent(true)
- setInstallDesktop(true)
- setEnableAgent(true)
- setForceReinstall(false)
- setPinRef('')
- setInstalling(false)
- setInstallError(null)
- setInstallUncertain(false)
- }, [])
-
- const applyLegacyHint = useCallback((payload: PluginInstallRequest, detected: ProbeResult) => {
- if (payload.legacyHint === 'agent') {
- setInstallAgent(Boolean(detected.agent))
- setInstallDesktop(false)
- } else if (payload.legacyHint === 'desktop') {
- setInstallAgent(false)
- setInstallDesktop(Boolean(detected.desktop))
- } else {
- setInstallAgent(Boolean(detected.agent))
- setInstallDesktop(Boolean(detected.desktop))
- }
- }, [])
-
- const runProbe = useCallback(
- async (payload: PluginInstallRequest) => {
- const token = ++probeToken.current
- setPhase('probing')
- setProbe(null)
- setInstallError(null)
- setInstallUncertain(false)
- // Reviewed catalog picks streamline the ceremony: enable defaults ON
- // (installing a reviewed entry to not use it is the rare case).
- setEnableAgent(payload.enable ?? true)
- setForceReinstall(payload.force ?? false)
-
- const probeFn = window.hermesDesktop?.probePluginRepo
-
- if (!probeFn) {
- if (token !== probeToken.current) {
- return
- }
-
- setPhase('error')
- setProbe({
- ok: false,
- agent: false,
- desktop: false,
- warnings: [],
- error: m.probeUnavailable
- })
+ return (
+ (subdir || base)
+ .replace(/\/+$/, '')
+ .split('/')
+ .pop()
+ ?.replace(/\.git$/, '') || repo
+ )
+}
- return
- }
+function pluginTitle(request: PluginInstallRequest, probe: null | ProbeResult): string {
+ return request.title || request.catalogName || probe?.agentName || probe?.desktopName || repoName(request.repo)
+}
- const result = await probeFn({ identifier: payload.repo })
+/** The inspection's one-line reason, when it could not read the repository. */
+function probeFailure(probe: null | ProbeResult, fallback: string): null | string {
+ return probe && !probe.ok ? probe.error || fallback : null
+}
- if (token !== probeToken.current) {
- return
- }
+function ProbeWarnings({ copy, probe }: { copy: InstallModalCopy; probe: null | ProbeResult }) {
+ const warnings = [...new Set([...(probe?.warnings ?? []), probe?.insecure ? copy.insecureWarning : ''])].filter(
+ Boolean
+ )
- setProbe(result)
+ if (!probe?.ok || warnings.length === 0) {
+ return null
+ }
- if (!result.ok) {
- setPhase('error')
+ return (
+ <div
+ className={cn(
+ CAPTION,
+ 'flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-foreground'
+ )}
+ >
+ <AlertTriangle aria-hidden className="mt-0.5 size-3.5 shrink-0 text-amber-600 dark:text-amber-400" />
+ <span>{warnings.join(' ')}</span>
+ </div>
+ )
+}
- return
- }
+/** "Install from Git" with no repository yet: one field, then the same dialog inspects what was pasted. */
+function RepositoryEntry({ request }: { request: PluginInstallRequest }) {
+ const { t } = useI18n()
+ const copy = t.settings.plugins.installModal
+ const [repo, setRepo] = useState('')
- applyLegacyHint(payload, result)
- setPhase('ready')
- },
- [applyLegacyHint, m.probeUnavailable]
+ return (
+ <form
+ className="space-y-3"
+ id="plugin-repository-form"
+ onSubmit={event => {
+ event.preventDefault()
+
+ if (repo.trim()) {
+ openPluginInstallRequest({ ...request, repo: repo.trim() })
+ }
+ }}
+ >
+ <label className="block space-y-1">
+ <span>{copy.repoLabel}</span>
+ <Input
+ autoFocus
+ onChange={event => setRepo(event.target.value)}
+ placeholder={copy.repoPlaceholder}
+ spellCheck={false}
+ value={repo}
+ />
+ </label>
+ <DialogFooter>
+ <Button onClick={closePluginInstallRequest} type="button" variant="outline">
+ {t.common.cancel}
+ </Button>
+ <Button disabled={!repo.trim()} type="submit">
+ {copy.reviewRepository}
+ </Button>
+ </DialogFooter>
+ </form>
)
+}
+
+/**
+ * THE plugin install dialog, for every door: a reviewed catalog pick (Plugins tab, `hermes://` link,
+ * the setup chat's plugins card) and a raw git URL. A catalog entry shows its name, one line, "Verified"
+ * and Install; its particulars wait behind Advanced. A git URL is marked Unverified with the same
+ * particulars open, because there they are the security check. Install always turns the plugin on
+ * (a deep link's explicit `enable=0` aside) and shows one loader until it is done.
+ */
+export function PluginInstallModal() {
+ const request = useStore($pluginInstallRequest)
+ const { t } = useI18n()
+ const m = t.settings.plugins.installModal
+ const navigate = useNavigate()
+ const onSettings = useLocation().pathname.startsWith(SETTINGS_ROUTE)
+ // Lifted so the dialog cannot be dismissed mid-install.
+ const [installing, setInstalling] = useState(false)
useEffect(() => {
if (request && onSettings) {
@@ -188,454 +152,256 @@ export function PluginInstallModal() {
}
}, [request, onSettings, navigate])
- useEffect(() => {
- if (!request) {
- resetState()
-
- return
- }
+ return (
+ <Dialog
+ onOpenChange={next => {
+ if (!next && !installing) {
+ closePluginInstallRequest()
+ }
+ }}
+ open={request !== null && !onSettings}
+ >
+ <DialogContent className="max-w-lg" onOpenAutoFocus={request?.repo ? preventCloseButtonAutoFocus : undefined}>
+ {request && !request.repo && (
+ <>
+ <DialogHeader>
+ <DialogTitle>{m.title}</DialogTitle>
+ <DialogDescription>{m.description}</DialogDescription>
+ </DialogHeader>
+ <RepositoryEntry request={request} />
+ </>
+ )}
+ {request?.repo && (
+ <InstallView
+ installing={installing}
+ key={request.repo}
+ onInstallingChange={setInstalling}
+ request={request}
+ />
+ )}
+ </DialogContent>
+ </Dialog>
+ )
+}
- setTargetProfile(normalizeProfileKey(request.profile || activeProfile || profileScope))
+/** Name, Verified/Unverified, the one line on what it does, then who reviewed it and where it lands. */
+function InstallHeader({
+ line,
+ probe,
+ request
+}: {
+ line: string
+ probe: null | ProbeResult
+ request: PluginInstallRequest
+}) {
+ const { t } = useI18n()
+ const m = t.settings.plugins.installModal
+ const verified = Boolean(request.catalogName)
- if (request.repo) {
- void runProbe(request)
- }
- }, [activeProfile, profileScope, request, resetState, runProbe])
-
- const targetProfileInfo = profiles.find(profile => normalizeProfileKey(profile.name) === targetProfile)
- const profileOptions = targetProfileInfo ? profiles : [...profiles, { name: targetProfile }]
- const targetProfileLabel = profileLabel(targetProfileInfo ?? { name: targetProfile })
-
- const agentTargetHint =
- connection?.mode === 'remote'
- ? m.agentTargetRemote(targetProfileLabel)
- : m.agentTargetLocal(
- targetProfileLabel,
- targetProfile === 'default' ? '~/.hermes/plugins/' : `~/.hermes/profiles/${targetProfile}/plugins/`
- )
-
- // A unified package installed into a local backend carries its own desktop
- // half; the app copies that half out of the package folder. Only a remote
- // backend (whose plugins/ folder this machine cannot read) or a desktop-only
- // repo needs a separate desktop clone.
- const desktopHalfFromPackage = Boolean(probe?.agent && installAgent && connection?.mode !== 'remote')
-
- const sourceLinks = useMemo(() => (request ? resolvePluginSourceLinks(request.repo) : null), [request])
-
- const handleClose = () => {
- if (installing) {
- return
- }
+ return (
+ <DialogHeader>
+ <div className="flex items-start gap-3">
+ <span className="grid size-9 shrink-0 place-items-center rounded-lg bg-(--ui-bg-quinary) text-(--ui-text-secondary)">
+ <Puzzle className="size-4" />
+ </span>
+ <div className="min-w-0 space-y-1">
+ <div className="flex flex-wrap items-center gap-2">
+ <DialogTitle>{pluginTitle(request, probe)}</DialogTitle>
+ <Badge variant={verified ? 'success' : 'warn'}>{verified ? m.verified : m.unverified}</Badge>
+ </div>
+ <DialogDescription>{request.summary || line}</DialogDescription>
+ {request.summary && <p className={cn(CAPTION, 'text-(--ui-text-secondary)')}>{line}</p>}
+ </div>
+ </div>
+ </DialogHeader>
+ )
+}
- probeToken.current += 1
- closePluginInstallRequest()
- }
+function Disclosure({
+ children,
+ label,
+ onToggle,
+ open
+}: {
+ children: ReactNode
+ label: string
+ onToggle: () => void
+ open: boolean
+}) {
+ return (
+ <div>
+ <button
+ aria-expanded={open}
+ className={cn(CAPTION, 'flex items-center gap-1.5 font-medium text-(--ui-text-secondary)')}
+ onClick={onToggle}
+ type="button"
+ >
+ <DisclosureCaret open={open} />
+ {label}
+ </button>
+ {open && <div className="pt-2">{children}</div>}
+ </div>
+ )
+}
- const handleInstall = async () => {
- if (!request || !probe?.ok || installing || installUncertain) {
- return
- }
+interface InstallFooterProps {
+ canInstall: boolean
+ failed: boolean
+ installing: boolean
+ onInstall: () => void
+ onRetry: () => void
+}
- if (!installAgent && !installDesktop) {
- setInstallError(m.selectComponent)
+/** Cancel, then Install (one loader while it runs) or, after a failure, Retry. */
+function InstallFooter({ canInstall, failed, installing, onInstall, onRetry }: InstallFooterProps) {
+ const { t } = useI18n()
+ const m = t.settings.plugins.installModal
- return
- }
+ return (
+ <DialogFooter>
+ <Button disabled={installing} onClick={closePluginInstallRequest} variant="outline">
+ {t.common.cancel}
+ </Button>
+ {failed ? (
+ <Button onClick={onRetry}>{t.common.retry}</Button>
+ ) : (
+ <Button disabled={!canInstall} onClick={onInstall}>
+ {installing && <Loader2 className="animate-spin" />}
+ {installing ? m.installing : m.install}
+ </Button>
+ )}
+ </DialogFooter>
+ )
+}
- setInstalling(true)
- setInstallError(null)
- setInstallUncertain(false)
+interface InstallViewProps {
+ request: PluginInstallRequest
+ installing: boolean
+ onInstallingChange: (installing: boolean) => void
+}
- const errors: string[] = []
- const successes: string[] = []
- let agentInstalled = false
- let agentResult: AgentPluginInstallResult | undefined
- let live: AgentPluginLiveNow = { mcpServers: [], skills: [] }
+function InstallView({ request, installing, onInstallingChange }: InstallViewProps) {
+ const { t } = useI18n()
+ const m = t.settings.plugins.installModal
+ const { requestGateway } = useGatewayRequest()
+ const navigate = useNavigate()
+ const remote = useStore($connection)?.mode === 'remote'
+ const activeProfile = useStore($activeGatewayProfile)
+ const profiles = useStore($profiles)
+ const profileScope = useStore($profileScope)
+ const verified = Boolean(request.catalogName)
+ const enable = request.enable ?? true
+ const { probe, start, cancel, settled } = usePluginProbe(m.probeUnavailable)
- try {
- if (installAgent && probe.agent) {
- const result = await installAgentPlugin(requestGateway, {
- identifier: request.repo,
- force: forceReinstall,
- enable: enableAgent,
- catalogName: request.catalogName,
- ref: pinRefTrimmed || undefined,
- profile: targetProfile
- })
-
- if (result.ok) {
- successes.push(
- [
- m.agentSuccess(result.pluginName ?? request.repo),
- ...installOutcome(m, result.live, result.nextChat)
- ].join(' · ')
- )
- agentInstalled = true
- agentResult = result
- live = result.live
-
- if (result.missingEnv?.length) {
- const firstVar = result.missingEnv[0]
-
- notify({
- kind: 'warning',
- message: m.missingEnv(result.pluginName ?? request.repo, result.missingEnv.join(', ')),
- // Deep-link straight to the credential card instead of leaving
- // the user to hunt through Settings → Tools & Keys by hand.
- action: {
- label: m.missingEnvAction,
- onClick: () => navigate(`/settings?tab=keys&key=${encodeURIComponent(firstVar)}`)
- }
- })
- }
-
- for (const warning of result.warnings ?? []) {
- notify({ kind: 'warning', message: warning })
- }
- } else if (result.timedOut) {
- // A client timeout does not cancel the backend install. Do not clone
- // the desktop half or offer a retry while the package may still be
- // installing. A read-only list refresh can show an already landed
- // package; the user can rescan later if the backend is still busy.
- setInstallUncertain(true)
- void loadAgentPlugins(requestGateway, targetProfile)
-
- return
- } else {
- errors.push(result.error || m.agentFailed)
- }
- }
+ const [targetProfile, setTargetProfile] = useState(() =>
+ normalizeProfileKey(request.profile || activeProfile || profileScope)
+ )
- if (installDesktop && probe.desktop) {
- if (desktopHalfFromPackage) {
- // Unified package into a LOCAL backend: the desktop half ships inside
- // the package folder. Materialise it from there (one source of truth,
- // follows updates/uninstall) instead of cloning a second, standalone
- // copy under another folder name. This holds whether or not the agent
- // install above succeeded: a package already on disk answers "already
- // exists" without Force, and falling through to the clone would land
- // desktop-plugins/<git-name>/ beside the package copy (#100412). When
- // there is nothing to materialise, nothing was installed. The agent
- // error already says so.
- const touched = (await window.hermesDesktop?.reconcileDesktopPlugins?.()) ?? []
-
- if (agentInstalled || touched.length > 0) {
- successes.push(m.desktopSuccess(probe.agentName ?? request.repo))
- }
-
- if (touched.length > 0) {
- await discoverRuntimePlugins()
- }
- } else {
- const installFn = window.hermesDesktop?.installDesktopPlugin
-
- if (!installFn) {
- errors.push(m.desktopUnavailable)
- } else {
- const result = await installFn({ identifier: request.repo, force: forceReinstall })
-
- if (result.ok) {
- successes.push(m.desktopSuccess(result.pluginName ?? request.repo))
- await discoverRuntimePlugins()
- } else {
- errors.push(result.error || m.desktopFailed)
- }
- }
- }
+ const [advancedOpen, setAdvancedOpen] = useState(!verified)
+ const [force, setForce] = useState(request.force ?? false)
+ const [pinRef, setPinRef] = useState('')
+ const [installError, setInstallError] = useState<null | string>(null)
+ const [installUncertain, setInstallUncertain] = useState(false)
- await enableInstalledDesktopHalf(agentResult)
- }
+ useEffect(() => {
+ start(request.repo)
- await loadAgentPlugins(requestGateway, targetProfile)
+ return cancel
+ }, [cancel, request.repo, start])
- if (errors.length === 0) {
- for (const message of successes) {
- notify({ kind: 'success', message })
- }
+ const targetInfo = profiles.find(profile => normalizeProfileKey(profile.name) === targetProfile)
+ const targetLabel = profileLabel(targetInfo ?? { name: targetProfile })
+ const pin = pinRef.trim().toLowerCase()
+ const pinInvalid = pin !== '' && !COMMIT_SHA_RE.test(pin)
+ // Hidden while a retry runs, so the loader is the only thing on screen.
+ const failure = installing ? null : (installError ?? probeFailure(probe, m.probeUnavailable))
+ const line = `${verified ? m.reviewedByNous : m.securityIntro} ${(enable ? m.installsAndEnables : m.installsOnly)(targetLabel)}`
- // Open chats of the profile already have the plugin's MCP tools and skills (no click).
- if (agentInstalled && enableAgent) {
- for (const server of live.mcpServers.filter(s => !s.connected)) {
- notify({ kind: 'warning', message: m.serverNotConnected(server.name, server.error || '') })
- }
- }
+ const install = async () => {
+ onInstallingChange(true)
+ setInstallError(null)
- finishInstall(request, navigate)
+ try {
+ // A catalog pick may click Install while the inspection is still running: wait for it under the loader.
+ const detected = await settled()
+ if (!detected?.ok) {
return
}
- if (successes.length > 0) {
- for (const message of successes) {
- notify({ kind: 'success', message })
- }
- }
+ const outcome = await runPluginInstall(
+ { request, probe: detected, profile: targetProfile, enable, force, ref: pin || undefined, remote },
+ { copy: m, navigate, requestGateway }
+ )
- setInstallError(errors.join('\n'))
+ if (outcome.status === 'done') {
+ finishInstall(request, navigate)
+ } else if (outcome.status === 'uncertain') {
+ setInstallUncertain(true)
+ } else {
+ setInstallError(outcome.error)
+ }
} finally {
- setInstalling(false)
+ onInstallingChange(false)
+ }
+ }
+
+ const retry = () => {
+ if (installError) {
+ void install()
+ } else {
+ start(request.repo)
}
}
- const open = request !== null && !onSettings
- const busy = phase === 'probing' || installing
- const pinRefTrimmed = pinRef.trim().toLowerCase()
- const pinRefInvalid = pinRefTrimmed !== '' && !COMMIT_SHA_RE.test(pinRefTrimmed)
+ // An unverified repository installs only once its contents are on screen; a reviewed pick may start at once.
+ const canInstall = !installing && !installUncertain && !pinInvalid && (verified || Boolean(probe?.ok))
return (
- <Dialog
- onOpenChange={next => {
- if (!next) {
- handleClose()
- }
- }}
- open={open}
- >
- <DialogContent className="max-w-lg" onOpenAutoFocus={request?.repo ? preventCloseButtonAutoFocus : undefined}>
- <DialogHeader>
- <DialogTitle>{m.title}</DialogTitle>
- <DialogDescription>{m.description}</DialogDescription>
- </DialogHeader>
-
- {request && !request.repo && (
- <form
- className="space-y-3"
- id="plugin-repository-form"
- onSubmit={event => {
- event.preventDefault()
- const repo = repoInput.trim()
-
- if (repo) {
- openPluginInstallRequest({ ...request, repo })
- }
+ <>
+ <InstallHeader line={line} probe={probe} request={request} />
+
+ <div className="space-y-3">
+ <ProbeWarnings copy={m} probe={probe} />
+
+ <Disclosure label={m.advanced} onToggle={() => setAdvancedOpen(open => !open)} open={advancedOpen}>
+ <PluginInstallDetails
+ busy={installing}
+ copy={m}
+ force={force}
+ onForceChange={setForce}
+ pin={{ value: pinRef, invalid: pinInvalid, onChange: setPinRef }}
+ probe={probe}
+ profile={{
+ value: targetProfile,
+ label: targetLabel,
+ options: targetInfo ? profiles : [...profiles, { name: targetProfile }],
+ onChange: setTargetProfile
}}
- >
- <label className="block space-y-1">
- <span>{m.repoLabel}</span>
- <Input
- autoFocus
- onChange={event => setRepoInput(event.target.value)}
- placeholder={m.repoPlaceholder}
- spellCheck={false}
- value={repoInput}
- />
- </label>
- </form>
+ remote={remote}
+ request={request}
+ />
+ </Disclosure>
+
+ {failure && (
+ <p className={cn(CAPTION, 'text-destructive')} role="alert">
+ {failure}
+ </p>
)}
-
- {request?.repo && (
- <div className="space-y-4">
- <div>
- <div className="mb-1 text-[length:var(--conversation-caption-font-size)] font-medium text-foreground">
- {m.repoLabel}
- </div>
- <div className="rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) px-3 py-2 font-mono text-[length:var(--conversation-caption-font-size)] break-all text-foreground">
- {request.repo}
- </div>
- {request.catalogName && (
- <p className="mt-1 text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
- {m.catalogPinned(request.catalogName, request.sha?.slice(0, 8) ?? '')}
- </p>
- )}
- </div>
-
- <div className="space-y-3 rounded-lg border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) px-3 py-2.5">
- <div className="space-y-2 text-[length:var(--conversation-caption-font-size)]">
- <div className="font-medium text-foreground">
- {request.catalogName ? m.reviewedHeading : m.securityHeading}
- </div>
- <p className="text-(--ui-text-secondary)">{request.catalogName ? m.reviewedIntro : m.securityIntro}</p>
- </div>
-
- {sourceLinks && (
- <div className="space-y-2 border-t border-(--ui-stroke-tertiary) pt-3">
- <div className="font-medium text-foreground">{m.sourceHeading}</div>
- {sourceLinks.browseUrl && (
- <ExternalLink
- className="text-[length:var(--conversation-caption-font-size)]"
- href={sourceLinks.browseUrl}
- showExternalIcon
- >
- {sourceLinks.subdir ? m.viewPluginFiles : m.viewRepository}
- </ExternalLink>
- )}
- <div>
- <div className="mb-1 text-(--ui-text-tertiary)">{m.gitCloneLabel}</div>
- <div className="rounded-md border border-(--ui-stroke-tertiary) bg-(--ui-bg-primary) px-2.5 py-1.5 font-mono break-all text-foreground">
- {sourceLinks.gitUrl}
- </div>
- </div>
- </div>
- )}
- </div>
-
- {phase === 'probing' && (
- <p className="text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
- {m.probing}
- </p>
- )}
-
- {phase === 'error' && probe?.error && (
- <p className="rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-[length:var(--conversation-caption-font-size)] text-destructive">
- {probe.error}
- </p>
- )}
-
- {phase === 'ready' && probe && (
- <div className="space-y-3">
- <div className="text-[length:var(--conversation-caption-font-size)] font-medium text-foreground">
- {m.includesHeading}
- </div>
-
- {probe.agent && (
- <div className="space-y-2 rounded-lg border border-(--ui-stroke-tertiary) px-3 py-2">
- <label className="flex items-start gap-3">
- <Checkbox
- checked={installAgent}
- disabled={busy}
- onCheckedChange={value => setInstallAgent(value === true)}
- />
- <span className="min-w-0">
- <span className="block font-medium text-foreground">{m.agentLabel}</span>
- <span className="block text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
- {agentTargetHint}
- {probe.agentName ? ` · ${probe.agentName}` : ''}
- </span>
- </span>
- </label>
- <label className="block space-y-1 pl-7">
- <span className="text-[length:var(--conversation-caption-font-size)] text-foreground">
- {m.profileLabel}
- </span>
- <Select disabled={busy || !installAgent} onValueChange={setTargetProfile} value={targetProfile}>
- <SelectTrigger aria-label={m.profileLabel} className="w-full">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {profileOptions.map(profile => (
- <SelectItem key={profile.name} value={normalizeProfileKey(profile.name)}>
- {profileLabel(profile)}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </label>
- </div>
- )}
-
- {probe.desktop && (
- <label className="flex items-start gap-3 rounded-lg border border-(--ui-stroke-tertiary) px-3 py-2">
- <Checkbox
- checked={installDesktop}
- disabled={busy}
- onCheckedChange={value => setInstallDesktop(value === true)}
- />
- <span className="min-w-0">
- <span className="block font-medium text-foreground">{m.desktopLabel}</span>
- <span className="block text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
- {desktopHalfFromPackage ? m.desktopTargetFromPackage : m.desktopTarget}
- {desktopHalfFromPackage ? '' : probe.desktopName ? ` · ${probe.desktopName}` : ''}
- </span>
- </span>
- </label>
- )}
-
- {probe.desktop && !probe.agent && (
- <p className="text-[length:var(--conversation-caption-font-size)] text-(--ui-text-tertiary)">
- {m.desktopOnlyNote}
- </p>
- )}
-
- {(probe.insecure || (probe.warnings?.length ?? 0) > 0) && (
- <div className="flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[length:var(--conversation-caption-font-size)] text-foreground">
- <AlertTriangle
- aria-hidden
- className="mt-0.5 size-3.5 shrink-0 text-amber-600 dark:text-amber-400"
- />
- <span>
- {[...new Set([...(probe.warnings ?? []), probe.insecure ? m.insecureWarning : ''])]
- .filter(Boolean)
- .join(' ')}
- </span>
- </div>
- )}
-
- {probe.agent && (
- <label className="flex items-center justify-between gap-3">
- <span className="text-[length:var(--conversation-caption-font-size)] text-foreground">
- {m.enableAgent}
- </span>
- <Switch checked={enableAgent} disabled={busy || !installAgent} onCheckedChange={setEnableAgent} />
- </label>
- )}
-
- {!request.catalogName && (
- <label className="flex items-center justify-between gap-3">
- <span className="text-[length:var(--conversation-caption-font-size)] text-foreground">
- {m.forceReinstall}
- </span>
- <Switch checked={forceReinstall} disabled={busy} onCheckedChange={setForceReinstall} />
- </label>
- )}
-
- {!request.catalogName && probe.agent && (
- <label className="block space-y-1">
- <span className="text-[length:var(--conversation-caption-font-size)] text-foreground">
- {m.pinToCommit}
- </span>
- <Input
- aria-invalid={pinRefInvalid || undefined}
- aria-label={m.pinToCommit}
- disabled={busy || !installAgent}
- onChange={event => setPinRef(event.target.value)}
- placeholder={m.pinToCommitPlaceholder}
- spellCheck={false}
- value={pinRef}
- />
- <span
- className={`block text-[length:var(--conversation-caption-font-size)] ${pinRefInvalid ? 'text-destructive' : 'text-(--ui-text-tertiary)'}`}
- >
- {pinRefInvalid ? m.pinToCommitInvalid : m.pinToCommitHint}
- </span>
- </label>
- )}
- </div>
- )}
-
- {installError && (
- <p className="rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 whitespace-pre-wrap text-[length:var(--conversation-caption-font-size)] text-destructive">
- {installError}
- </p>
- )}
- {installUncertain && (
- <p
- className="text-[length:var(--conversation-caption-font-size)] text-(--ui-text-secondary)"
- role="status"
- >
- {m.installUncertain}
- </p>
- )}
- </div>
+ {installUncertain && (
+ <p className={cn(CAPTION, 'text-(--ui-text-secondary)')} role="status">
+ {m.installUncertain}
+ </p>
)}
-
- <DialogFooter>
- <Button disabled={busy} onClick={handleClose} variant="outline">
- {t.common.cancel}
- </Button>
- {request && !request.repo ? (
- <Button disabled={!repoInput.trim()} form="plugin-repository-form" type="submit">
- {m.reviewRepository}
- </Button>
- ) : (
- <Button
- disabled={busy || installUncertain || phase !== 'ready' || !probe?.ok || pinRefInvalid}
- onClick={() => void handleInstall()}
- >
- {installing ? m.installing : m.install}
- </Button>
- )}
- </DialogFooter>
- </DialogContent>
- </Dialog>
+ </div>
+
+ <InstallFooter
+ canInstall={canInstall}
+ failed={Boolean(failure)}
+ installing={installing}
+ onInstall={() => void install()}
+ onRetry={retry}
+ />
+ </>
)
}
diff --git a/apps/desktop/src/app/settings/plugin-install-run.ts b/apps/desktop/src/app/settings/plugin-install-run.ts
new file mode 100644
index 00000000000..92fecb3b404
--- /dev/null
+++ b/apps/desktop/src/app/settings/plugin-install-run.ts
@@ -0,0 +1,216 @@
+import { enablePackageDesktopHalf } from '@/contrib/plugins-store'
+import { discoverRuntimePlugins } from '@/contrib/runtime-loader'
+import type { useI18n } from '@/i18n'
+import {
+ type AgentPluginInstallResult,
+ type AgentPluginLiveNow,
+ type GatewayRequest,
+ installAgentPlugin,
+ loadAgentPlugins
+} from '@/store/agent-plugins'
+import { notify } from '@/store/notifications'
+import type { PluginInstallRequest } from '@/store/plugin-install-request'
+
+export type ProbeResult = Awaited<ReturnType<NonNullable<NonNullable<Window['hermesDesktop']>['probePluginRepo']>>>
+
+export type InstallModalCopy = ReturnType<typeof useI18n>['t']['settings']['plugins']['installModal']
+
+export interface InstallComponents {
+ agent: boolean
+ desktop: boolean
+}
+
+const HINT_COMPONENTS: Record<'agent' | 'both' | 'desktop', (probe: ProbeResult) => InstallComponents> = {
+ agent: probe => ({ agent: probe.agent, desktop: false }),
+ both: probe => ({ agent: probe.agent, desktop: probe.desktop }),
+ desktop: probe => ({ agent: false, desktop: probe.desktop })
+}
+
+/** What an install puts down: every half the repository has, narrowed by a legacy deep link or by
+ * "install the agent half here" (whose desktop half is already loaded). */
+export function installComponents(request: PluginInstallRequest, probe: ProbeResult): InstallComponents {
+ return HINT_COMPONENTS[request.legacyHint ?? 'both'](probe)
+}
+
+/** A unified package installed into a local backend carries its own desktop half; the app copies that half
+ * out of the package folder. Only a remote backend (whose plugins/ folder this machine cannot read) or a
+ * desktop-only repo needs a separate desktop clone. */
+export function desktopHalfFromPackage(components: InstallComponents, remote: boolean): boolean {
+ return components.agent && !remote
+}
+
+export interface InstallPlan {
+ request: PluginInstallRequest
+ probe: ProbeResult
+ profile: string
+ enable: boolean
+ force: boolean
+ ref?: string
+ remote: boolean
+}
+
+export interface InstallDeps {
+ copy: InstallModalCopy
+ navigate: (to: string) => void
+ requestGateway: GatewayRequest
+}
+
+export type InstallOutcome = { error: string; status: 'failed' } | { status: 'done' } | { status: 'uncertain' }
+
+interface Report {
+ errors: string[]
+ successes: string[]
+}
+
+/** What an agent-plugin install made usable, as toast fragments ("12 tools connected", ...). */
+function installOutcome(m: InstallModalCopy, live: AgentPluginLiveNow, nextChat: boolean): string[] {
+ const tools = live.mcpServers.reduce((n, server) => n + (server.connected ? server.tools.length : 0), 0)
+
+ return [
+ ...(tools > 0 ? [m.toolsConnected(tools)] : []),
+ ...(live.skills.length > 0 ? [m.skillsReady(live.skills)] : []),
+ ...(nextChat ? [m.nextChat] : [])
+ ]
+}
+
+function notifyAgentFollowUps(result: AgentPluginInstallResult, name: string, deps: InstallDeps): void {
+ const firstVar = result.missingEnv?.[0]
+
+ if (firstVar) {
+ notify({
+ kind: 'warning',
+ message: deps.copy.missingEnv(name, result.missingEnv!.join(', ')),
+ // Deep-link straight to the credential card instead of leaving the user to hunt through Settings.
+ action: {
+ label: deps.copy.missingEnvAction,
+ onClick: () => deps.navigate(`/settings?tab=keys&key=${encodeURIComponent(firstVar)}`)
+ }
+ })
+ }
+
+ for (const warning of result.warnings ?? []) {
+ notify({ kind: 'warning', message: warning })
+ }
+}
+
+async function installAgentHalf(plan: InstallPlan, deps: InstallDeps, report: Report) {
+ const { request } = plan
+
+ const result = await installAgentPlugin(deps.requestGateway, {
+ identifier: request.repo,
+ force: plan.force,
+ enable: plan.enable,
+ catalogName: request.catalogName,
+ ref: plan.ref,
+ profile: plan.profile
+ })
+
+ if (!result.ok) {
+ report.errors.push(result.error || deps.copy.agentFailed)
+
+ return result
+ }
+
+ const name = result.pluginName ?? request.repo
+
+ report.successes.push(
+ [deps.copy.agentSuccess(name), ...installOutcome(deps.copy, result.live, result.nextChat)].join(' · ')
+ )
+ notifyAgentFollowUps(result, name, deps)
+
+ return result
+}
+
+async function cloneDesktopHalf(plan: InstallPlan, copy: InstallModalCopy, report: Report): Promise<void> {
+ const installFn = window.hermesDesktop?.installDesktopPlugin
+
+ if (!installFn) {
+ report.errors.push(copy.desktopUnavailable)
+
+ return
+ }
+
+ const result = await installFn({ identifier: plan.request.repo, force: plan.force })
+
+ if (!result.ok) {
+ report.errors.push(result.error || copy.desktopFailed)
+
+ return
+ }
+
+ report.successes.push(copy.desktopSuccess(result.pluginName ?? plan.request.repo))
+ await discoverRuntimePlugins()
+}
+
+async function installDesktopHalf(
+ plan: InstallPlan,
+ components: InstallComponents,
+ copy: InstallModalCopy,
+ report: Report,
+ agentResult?: AgentPluginInstallResult
+): Promise<void> {
+ if (desktopHalfFromPackage(components, plan.remote)) {
+ // The desktop half ships inside the package folder: materialise it from there (one source of truth,
+ // follows updates/uninstall) whether or not the agent install succeeded. A package already on disk
+ // answers "already exists" without Force, and cloning would land desktop-plugins/<git-name>/ beside
+ // the package copy (#100412).
+ const touched = (await window.hermesDesktop?.reconcileDesktopPlugins?.()) ?? []
+
+ if (agentResult?.ok || touched.length > 0) {
+ report.successes.push(copy.desktopSuccess(plan.probe.agentName ?? plan.request.repo))
+ }
+
+ if (touched.length > 0) {
+ await discoverRuntimePlugins()
+ }
+ } else {
+ await cloneDesktopHalf(plan, copy, report)
+ }
+
+ // The desktop half of a unified package lands opt-in; an install that enabled the agent half turns it on too.
+ if (agentResult?.enabled && agentResult.pluginName) {
+ await enablePackageDesktopHalf(agentResult.pluginName)
+ }
+}
+
+/** Install every half `installComponents` picks, then refresh the inventory. A client timeout on the agent
+ * half is `uncertain`: the backend may still be installing, so nothing else starts. */
+export async function runPluginInstall(plan: InstallPlan, deps: InstallDeps): Promise<InstallOutcome> {
+ const components = installComponents(plan.request, plan.probe)
+
+ if (!components.agent && !components.desktop) {
+ return { status: 'failed', error: deps.copy.nothingToInstall }
+ }
+
+ const report: Report = { errors: [], successes: [] }
+ const agentResult = components.agent ? await installAgentHalf(plan, deps, report) : undefined
+
+ if (agentResult?.timedOut) {
+ void loadAgentPlugins(deps.requestGateway, plan.profile)
+
+ return { status: 'uncertain' }
+ }
+
+ if (components.desktop) {
+ await installDesktopHalf(plan, components, deps.copy, report, agentResult)
+ }
+
+ await loadAgentPlugins(deps.requestGateway, plan.profile)
+
+ for (const message of report.successes) {
+ notify({ kind: 'success', message })
+ }
+
+ if (report.errors.length > 0) {
+ return { status: 'failed', error: report.errors.join(' ') }
+ }
+
+ // Open chats of the profile already have the plugin's MCP tools and skills; say which servers did not connect.
+ if (agentResult?.ok && plan.enable) {
+ for (const server of agentResult.live.mcpServers.filter(s => !s.connected)) {
+ notify({ kind: 'warning', message: deps.copy.serverNotConnected(server.name, server.error || '') })
+ }
+ }
+
+ return { status: 'done' }
+}
diff --git a/apps/desktop/src/app/settings/use-plugin-probe.ts b/apps/desktop/src/app/settings/use-plugin-probe.ts
new file mode 100644
index 00000000000..0923d06708e
--- /dev/null
+++ b/apps/desktop/src/app/settings/use-plugin-probe.ts
@@ -0,0 +1,44 @@
+import { useCallback, useRef, useState } from 'react'
+
+import type { ProbeResult } from './plugin-install-run'
+
+const NO_PROBE: Promise<null> = Promise.resolve(null)
+
+/** Inspect a repository once per request. `settled()` lets Install wait on an inspection still running, and a
+ * newer start (or `cancel`) turns every older answer stale, so a late result never paints over newer intent. */
+export function usePluginProbe(unavailableMessage: string) {
+ const [probe, setProbe] = useState<null | ProbeResult>(null)
+ const token = useRef(0)
+ const pending = useRef<Promise<null | ProbeResult>>(NO_PROBE)
+
+ const start = useCallback(
+ (repo: string) => {
+ const mine = ++token.current
+ const probeFn = window.hermesDesktop?.probePluginRepo
+
+ const run: Promise<ProbeResult> = probeFn
+ ? probeFn({ identifier: repo })
+ : Promise.resolve({ ok: false, agent: false, desktop: false, warnings: [], error: unavailableMessage })
+
+ setProbe(null)
+ pending.current = run.then(result => {
+ if (mine !== token.current) {
+ return null
+ }
+
+ setProbe(result)
+
+ return result
+ })
+ },
+ [unavailableMessage]
+ )
+
+ const cancel = useCallback(() => {
+ token.current += 1
+ pending.current = NO_PROBE
+ setProbe(null)
+ }, [])
+
+ return { probe, start, cancel, settled: () => pending.current }
+}
diff --git a/apps/desktop/src/components/assistant-ui/setup-beat/plugins-card.tsx b/apps/desktop/src/components/assistant-ui/setup-beat/plugins-card.tsx
index 7e57a140639..58c2a14a5eb 100644
--- a/apps/desktop/src/components/assistant-ui/setup-beat/plugins-card.tsx
+++ b/apps/desktop/src/components/assistant-ui/setup-beat/plugins-card.tsx
@@ -35,12 +35,12 @@ async function readPresence(owner: ConnectionOwner, names: string[]): Promise<Ca
return result.presence ?? []
}
-async function openInstall(name: string, profile: string): Promise<void> {
+async function openInstall(name: string, title: string, profile: string): Promise<void> {
const lookup = await lookupPluginCatalogEntry(name)
if (lookup.ok) {
// The card stays in the chat and flips the row to Installed when the plugin list reloads.
- openCatalogPluginInstall(lookup.entry, profile, { stayAfterInstall: true })
+ openCatalogPluginInstall(lookup.entry, profile, { stayAfterInstall: true, title })
}
}
@@ -109,7 +109,7 @@ export function PluginsCard({
on={on}
onToggle={() => {
if (!on && owner) {
- void openInstall(row.name, owner.profile)
+ void openInstall(row.name, row.title || row.name, owner.profile)
}
}}
sub={on ? copy.installed : row.sentence || copy.install}
diff --git a/apps/desktop/src/i18n/ar_settings.ts b/apps/desktop/src/i18n/ar_settings.ts
index 1662a0ab45d..f9050862696 100644
--- a/apps/desktop/src/i18n/ar_settings.ts
+++ b/apps/desktop/src/i18n/ar_settings.ts
@@ -182,7 +182,17 @@ export const arSettings = {
toolsConnected: n => `تم توصيل ${n} من الأدوات`,
skillsReady: names => (names.length === 1 ? `المهارة ${names[0]} جاهزة` : `${names.length} من المهارات جاهزة`),
nextChat: 'أدوات أخرى متاحة في دردشتك التالية',
- serverNotConnected: (server, reason) => `خادم MCP ${server} غير متصل${reason ? `: ${reason}` : '.'}`
+ serverNotConnected: (server, reason) => `خادم MCP ${server} غير متصل${reason ? `: ${reason}` : '.'}`,
+ verified: 'موثّق',
+ unverified: 'غير موثّق',
+ reviewedByNous: 'راجعته Nous.',
+ installsAndEnables: profile => `يُثبَّت لملف ${profile} ويعمل فورًا.`,
+ installsOnly: profile => `يُثبَّت لملف ${profile}.`,
+ advanced: 'متقدم',
+ versionLabel: 'الإصدار',
+ reviewedPin: sha => (sha ? `الإصدار المثبّت المراجَع ${sha}` : 'الإصدار المثبّت المراجَع'),
+ latestCommit: 'أحدث إيداع',
+ nothingToInstall: 'لا تحتوي هذه الحزمة على ما يُثبَّت هنا.'
}
},
notifications: {
diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.ts
index f7712920b9e..c32d9d75f64 100644
--- a/apps/desktop/src/i18n/de.ts
+++ b/apps/desktop/src/i18n/de.ts
@@ -791,11 +791,6 @@ export const deOverrides = {
profileLabel: 'Für Profil installieren',
agentTargetLocal: (profile, dir) => `Wird in das Backend ${profile} installiert (${dir})`,
agentTargetRemote: profile => `Installiert in das verbundene ${profile}-Backend`,
- catalogPinned: (name, sha) =>
- `Hermes-Katalog-Eintrag „${name}" — die Agent-Komponente wird am geprüften Pin installiert${sha ? ` ${sha}` : ''}, nicht an der Spitze des Branches.`,
- reviewedHeading: 'Geprüfter Katalog-Eintrag',
- reviewedIntro:
- 'Dieser Eintrag wurde an seinem gepinnten Commit von einem Menschen geprüft. Sie können den genauen Code trotzdem unten ansehen.',
toolsConnected: n => (n === 1 ? '1 Tool verbunden' : `${n} Tools verbunden`),
skillsReady: names => (names.length === 1 ? `Skill ${names[0]} bereit` : `${names.length} Skills bereit`),
nextChat: 'weitere Tools in Ihrem nächsten Chat verfügbar',
@@ -808,13 +803,11 @@ export const deOverrides = {
desktopOnlyNote: 'Nur-Desktop-Pakete installieren kein Backend-Agent-Plugin.',
insecureWarning:
'Diese URL verwendet ein unsicheres oder lokales Schema. Für Produktionsinstallationen bevorzuge https:// oder git@.',
- securityHeading: 'Vor der Installation',
securityIntro:
'Installieren Sie nur aus Quellen, denen Sie vertrauen – prüfen Sie das Repository unten, wenn Sie sehen möchten, was hinzugefügt wird.',
sourceHeading: 'Quellcode',
viewRepository: 'Repository ansehen',
viewPluginFiles: 'Plugin-Dateien ansehen',
- gitCloneLabel: 'Git-Clone-URL',
enableAgent: 'Agent-Plugin nach der Installation aktivieren',
forceReinstall: 'Neuinstallation erzwingen (ersetzen, falls bereits installiert)',
pinToCommit: 'An Commit binden (optional)',
@@ -836,7 +829,17 @@ export const deOverrides = {
'Hermes wartet nicht mehr auf das Installationsergebnis, aber das Plugin wird möglicherweise noch installiert. Schließe dieses Fenster und aktualisiere die Pluginliste, bevor du die Installation erneut startest.',
desktopFailed: 'Installation des Desktop-Plugins fehlgeschlagen',
missingEnv: (name, vars) =>
- `${name} ist installiert, benötigt aber einen Schlüssel, um zu funktionieren: ${vars}. Fügen Sie ihn jetzt hinzu, sonst schlagen die Tools des Plugins fehl.`
+ `${name} ist installiert, benötigt aber einen Schlüssel, um zu funktionieren: ${vars}. Fügen Sie ihn jetzt hinzu, sonst schlagen die Tools des Plugins fehl.`,
+ verified: 'Verifiziert',
+ unverified: 'Nicht verifiziert',
+ reviewedByNous: 'Von Nous geprüft.',
+ installsAndEnables: profile => `Wird für ${profile} installiert und sofort eingeschaltet.`,
+ installsOnly: profile => `Wird für ${profile} installiert.`,
+ advanced: 'Erweitert',
+ versionLabel: 'Version',
+ reviewedPin: sha => (sha ? `Geprüfter Pin ${sha}` : 'Geprüfter Pin'),
+ latestCommit: 'Neuester Commit',
+ nothingToInstall: 'Dieses Paket hat hier nichts zu installieren.'
}
},
vault: {
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index c538802e112..6927122f528 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -779,17 +779,22 @@ export const en: Translations = {
title: 'Install plugin',
description: 'Review what this repository contains before installing anything.',
repoLabel: 'Repository',
+ verified: 'Verified',
+ unverified: 'Unverified',
+ reviewedByNous: 'Reviewed by Nous.',
+ installsAndEnables: profile => `Installs for ${profile} and turns on right away.`,
+ installsOnly: profile => `Installs for ${profile}.`,
+ advanced: 'Advanced',
+ versionLabel: 'Version',
+ reviewedPin: sha => (sha ? `Reviewed pin ${sha}` : 'Reviewed pin'),
+ latestCommit: 'Latest commit',
+ nothingToInstall: 'This package has nothing to install here.',
includesHeading: 'This package includes',
agentLabel: 'Agent plugin',
desktopLabel: 'Desktop UI',
profileLabel: 'Install for profile',
agentTargetLocal: (profile, dir) => `Installs into the ${profile} backend (${dir})`,
agentTargetRemote: profile => `Installs into the connected ${profile} backend`,
- catalogPinned: (name, sha) =>
- `Hermes catalog entry "${name}" — the agent component installs at the reviewed pin${sha ? ` ${sha}` : ''}, not the branch tip.`,
- reviewedHeading: 'Reviewed catalog entry',
- reviewedIntro:
- 'This entry was human-reviewed at its pinned commit. You can still inspect the exact code below.',
toolsConnected: n => (n === 1 ? '1 tool connected' : `${n} tools connected`),
skillsReady: names => (names.length === 1 ? `skill ${names[0]} ready` : `${names.length} skills ready`),
nextChat: 'more tools available in your next chat',
@@ -800,13 +805,11 @@ export const en: Translations = {
desktopTargetFromPackage: 'Loaded into this app from the package above — same for every profile',
desktopOnlyNote: 'Desktop-only packages do not install a backend agent plugin.',
insecureWarning: 'This URL uses an insecure or local scheme. Prefer https:// or git@ for production installs.',
- securityHeading: 'Before you install',
securityIntro:
'Install only from sources you trust — review the repository below if you want to see what will be added.',
sourceHeading: 'Source code',
viewRepository: 'View repository',
viewPluginFiles: 'View plugin files',
- gitCloneLabel: 'Git clone URL',
enableAgent: 'Enable agent plugin after install',
forceReinstall: 'Force reinstall (replace if already installed)',
pinToCommit: 'Pin to commit (optional)',
diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.ts
index ee770b8bbe1..51939f70e74 100644
--- a/apps/desktop/src/i18n/es.ts
+++ b/apps/desktop/src/i18n/es.ts
@@ -795,11 +795,6 @@ export const esOverrides = {
profileLabel: 'Instalar para el perfil',
agentTargetLocal: (profile, dir) => `Se instala en el backend ${profile} (${dir})`,
agentTargetRemote: profile => `Se instala en el backend ${profile} conectado`,
- catalogPinned: (name, sha) =>
- `Entrada del catálogo de Hermes “${name}”: el componente del agente se instala en la versión fijada revisada${sha ? ` ${sha}` : ''}, no en la punta de la rama.`,
- reviewedHeading: 'Entrada del catálogo revisada',
- reviewedIntro:
- 'Una persona revisó esta entrada en su commit fijado. Aun así, puedes inspeccionar el código exacto abajo.',
toolsConnected: n => (n === 1 ? '1 herramienta conectada' : `${n} herramientas conectadas`),
skillsReady: names => (names.length === 1 ? `skill ${names[0]} lista` : `${names.length} skills listas`),
nextChat: 'más herramientas disponibles en tu próximo chat',
@@ -812,13 +807,11 @@ export const esOverrides = {
desktopOnlyNote: 'Los paquetes solo de escritorio no instalan un plugin del agente en el backend.',
insecureWarning:
'Esta URL usa un esquema inseguro o local. Para instalaciones de producción, usa https:// o git@.',
- securityHeading: 'Antes de instalar',
securityIntro:
'Instala solo desde fuentes de confianza; revisa el repositorio de abajo si quieres ver qué se añadirá.',
sourceHeading: 'Código fuente',
viewRepository: 'Ver repositorio',
viewPluginFiles: 'Ver archivos del plugin',
- gitCloneLabel: 'URL de git clone',
enableAgent: 'Activar el plugin del agente tras instalarlo',
forceReinstall: 'Forzar reinstalación (reemplazar si ya está instalado)',
pinToCommit: 'Fijar a un commit (opcional)',
@@ -839,7 +832,17 @@ export const esOverrides = {
'Hermes dejó de esperar el resultado de la instalación, pero es posible que el plugin siga instalándose. Cierra este cuadro y actualiza la lista de plugins antes de volver a instalarlo.',
desktopFailed: 'Error al instalar el plugin de escritorio',
missingEnv: (name, vars) =>
- `${name} está instalado, pero necesita una clave para funcionar: ${vars}. Añádela ahora o las herramientas del plugin fallarán.`
+ `${name} está instalado, pero necesita una clave para funcionar: ${vars}. Añádela ahora o las herramientas del plugin fallarán.`,
+ verified: 'Verificado',
+ unverified: 'Sin verificar',
+ reviewedByNous: 'Revisado por Nous.',
+ installsAndEnables: profile => `Se instala para ${profile} y se activa al momento.`,
+ installsOnly: profile => `Se instala para ${profile}.`,
+ advanced: 'Avanzado',
+ versionLabel: 'Versión',
+ reviewedPin: sha => (sha ? `Pin revisado ${sha}` : 'Pin revisado'),
+ latestCommit: 'Último commit',
+ nothingToInstall: 'Este paquete no tiene nada que instalar aquí.'
}
},
vault: {
diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.ts
index 96f43664f2d..64dacb08b03 100644
--- a/apps/desktop/src/i18n/fr.ts
+++ b/apps/desktop/src/i18n/fr.ts
@@ -792,11 +792,6 @@ export const frOverrides = {
profileLabel: 'Installer pour le profil',
agentTargetLocal: (profile, dir) => `Installe dans le backend ${profile} (${dir})`,
agentTargetRemote: profile => `S'installe dans le backend ${profile} connecté`,
- catalogPinned: (name, sha) =>
- `Entrée « ${name} » du catalogue Hermes — le composant agent sera installé depuis le commit vérifié${sha ? ` ${sha}` : ''}, et non depuis la tête de branche.`,
- reviewedHeading: 'Entrée du catalogue vérifiée',
- reviewedIntro:
- 'Cette entrée a été vérifiée manuellement à son commit épinglé. Vous pouvez encore examiner le code exact ci-dessous.',
toolsConnected: n => (n === 1 ? '1 outil connecté' : `${n} outils connectés`),
skillsReady: names => (names.length === 1 ? `skill ${names[0]} prêt` : `${names.length} skills prêts`),
nextChat: "d'autres outils disponibles dans votre prochaine conversation",
@@ -810,13 +805,11 @@ export const frOverrides = {
desktopOnlyNote: "Les paquets réservés au Desktop n'installent aucun plugin dans le backend.",
insecureWarning:
'Cette URL utilise un protocole non sécurisé ou local. Préférez https:// ou git@ en production.',
- securityHeading: "Avant l'installation",
securityIntro:
'Installez uniquement des sources de confiance — consultez le dépôt ci-dessous pour vérifier ce qui sera ajouté.',
sourceHeading: 'Code source',
viewRepository: 'Voir le dépôt',
viewPluginFiles: 'Voir les fichiers du plugin',
- gitCloneLabel: 'URL de clonage Git',
enableAgent: "Activer le plugin de l'agent après l'installation",
forceReinstall: 'Forcer la réinstallation (remplacer la version existante)',
pinToCommit: 'Épingler à un commit (facultatif)',
@@ -838,7 +831,17 @@ export const frOverrides = {
"Hermes n'attend plus le résultat de l'installation, mais le plugin est peut-être encore en cours d'installation. Fermez cette fenêtre et actualisez la liste des plugins avant de relancer l'installation.",
desktopFailed: "Échec de l'installation du plugin Desktop",
missingEnv: (name, vars) =>
- `${name} est installé, mais a besoin d'une clé pour fonctionner : ${vars}. Ajoutez-la maintenant, sinon les outils du plugin échoueront.`
+ `${name} est installé, mais a besoin d'une clé pour fonctionner : ${vars}. Ajoutez-la maintenant, sinon les outils du plugin échoueront.`,
+ verified: 'Vérifié',
+ unverified: 'Non vérifié',
+ reviewedByNous: 'Examiné par Nous.',
+ installsAndEnables: profile => `S’installe pour ${profile} et s’active tout de suite.`,
+ installsOnly: profile => `S’installe pour ${profile}.`,
+ advanced: 'Avancé',
+ versionLabel: 'Version',
+ reviewedPin: sha => (sha ? `Pin examiné ${sha}` : 'Pin examiné'),
+ latestCommit: 'Dernier commit',
+ nothingToInstall: 'Ce paquet n’a rien à installer ici.'
}
},
vault: {
diff --git a/apps/desktop/src/i18n/ja_plugins.ts b/apps/desktop/src/i18n/ja_plugins.ts
index 3e97855e95a..82f135e8dd6 100644
--- a/apps/desktop/src/i18n/ja_plugins.ts
+++ b/apps/desktop/src/i18n/ja_plugins.ts
@@ -27,7 +27,17 @@ export const jaPluginSettings = {
names.length === 1 ? `スキル ${names[0]} の準備ができました` : `${names.length} 個のスキルの準備ができました`,
nextChat: 'ほかのツールは次のチャットで使えます',
serverNotConnected: (server, reason) =>
- `MCP サーバー ${server} は接続されていません${reason ? `: ${reason}` : '。'}`
+ `MCP サーバー ${server} は接続されていません${reason ? `: ${reason}` : '。'}`,
+ verified: '確認済み',
+ unverified: '未確認',
+ reviewedByNous: 'Nous がレビュー済み。',
+ installsAndEnables: profile => `${profile} にインストールし、すぐに有効になります。`,
+ installsOnly: profile => `${profile} にインストールします。`,
+ advanced: '詳細設定',
+ versionLabel: 'バージョン',
+ reviewedPin: sha => (sha ? `レビュー済みのピン ${sha}` : 'レビュー済みのピン'),
+ latestCommit: '最新のコミット',
+ nothingToInstall: 'このパッケージにはここでインストールするものがありません。'
}
}
} satisfies Pick<SettingsOverrides, 'pluginPages' | 'plugins'>
diff --git a/apps/desktop/src/i18n/overlay-gaps.json b/apps/desktop/src/i18n/overlay-gaps.json
index f558b8fe828..8a12381a470 100644
--- a/apps/desktop/src/i18n/overlay-gaps.json
+++ b/apps/desktop/src/i18n/overlay-gaps.json
@@ -1628,7 +1628,6 @@
"settings.plugins.installModal.agentTargetLocal": ["ar","ja","zh-hant"],
"settings.plugins.installModal.agentTargetRemote": ["ar","ja","zh-hant"],
"settings.plugins.installModal.alreadyInstalled": ["ar","ja","ru","zh-hant"],
- "settings.plugins.installModal.catalogPinned": ["ar","ja","ru","zh-hant"],
"settings.plugins.installModal.description": ["ar","ja","zh-hant"],
"settings.plugins.installModal.desktopFailed": ["ar","ja","zh-hant"],
"settings.plugins.installModal.desktopLabel": ["ar","ja","zh-hant"],
@@ -1639,7 +1638,6 @@
"settings.plugins.installModal.desktopUnavailable": ["ar","ja","zh-hant"],
"settings.plugins.installModal.enableAgent": ["ar","ja","zh-hant"],
"settings.plugins.installModal.forceReinstall": ["ar","ja","zh-hant"],
- "settings.plugins.installModal.gitCloneLabel": ["ar","ja","zh-hant"],
"settings.plugins.installModal.includesHeading": ["ar","ja","zh-hant"],
"settings.plugins.installModal.insecureWarning": ["ar","ja","zh-hant"],
"settings.plugins.installModal.install": ["ar","ja","zh-hant"],
@@ -1657,9 +1655,6 @@
"settings.plugins.installModal.repoLabel": ["ar","ja","zh-hant"],
"settings.plugins.installModal.repoPlaceholder": ["ar","ru"],
"settings.plugins.installModal.reviewRepository": ["ar","ru"],
- "settings.plugins.installModal.reviewedHeading": ["ar","ja","ru","zh-hant"],
- "settings.plugins.installModal.reviewedIntro": ["ar","ja","ru","zh-hant"],
- "settings.plugins.installModal.securityHeading": ["ar","ja","zh-hant"],
"settings.plugins.installModal.securityIntro": ["ar","ja","zh-hant"],
"settings.plugins.installModal.selectComponent": ["ar","ja","zh-hant"],
"settings.plugins.installModal.sourceHeading": ["ar","ja","zh-hant"],
diff --git a/apps/desktop/src/i18n/ru_plugins.ts b/apps/desktop/src/i18n/ru_plugins.ts
index a0b4ccea169..d525961b38d 100644
--- a/apps/desktop/src/i18n/ru_plugins.ts
+++ b/apps/desktop/src/i18n/ru_plugins.ts
@@ -35,13 +35,11 @@ export const ruPluginSettings = {
desktopOnlyNote: 'Пакеты только для приложения не устанавливают плагин агента.',
insecureWarning:
'Этот URL использует небезопасную или локальную схему. Для боевой установки предпочитайте https:// или git@.',
- securityHeading: 'Перед установкой',
securityIntro:
'Устанавливайте только из проверенных источников — при желании просмотрите репозиторий ниже, чтобы увидеть, что будет добавлено.',
sourceHeading: 'Исходный код',
viewRepository: 'Посмотреть репозиторий',
viewPluginFiles: 'Посмотреть файлы плагина',
- gitCloneLabel: 'URL для git clone',
enableAgent: 'Включить плагин агента после установки',
forceReinstall: 'Принудительная переустановка (заменить, если уже установлен)',
pinToCommit: 'Закрепить на коммите (необязательно)',
@@ -65,7 +63,17 @@ export const ruPluginSettings = {
toolsConnected: n => `Подключено инструментов: ${n}`,
skillsReady: names => (names.length === 1 ? `навык ${names[0]} готов` : `готово навыков: ${names.length}`),
nextChat: 'остальные инструменты появятся в следующем чате',
- serverNotConnected: (server, reason) => `MCP-сервер ${server} не подключён${reason ? `: ${reason}` : '.'}`
+ serverNotConnected: (server, reason) => `MCP-сервер ${server} не подключён${reason ? `: ${reason}` : '.'}`,
+ verified: 'Проверен',
+ unverified: 'Не проверен',
+ reviewedByNous: 'Проверен Nous.',
+ installsAndEnables: profile => `Устанавливается для ${profile} и сразу включается.`,
+ installsOnly: profile => `Устанавливается для ${profile}.`,
+ advanced: 'Дополнительно',
+ versionLabel: 'Версия',
+ reviewedPin: sha => (sha ? `Проверенный пин ${sha}` : 'Проверенный пин'),
+ latestCommit: 'Последний коммит',
+ nothingToInstall: 'В этом пакете нечего устанавливать здесь.'
}
}
} satisfies Pick<SettingsOverrides, 'pluginPages' | 'plugins'>
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index b736e544415..e8e7a110cd5 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -638,15 +638,22 @@ export interface Translations extends NoticeTranslations {
title: string
description: string
repoLabel: string
+ verified: string
+ unverified: string
+ reviewedByNous: string
+ installsAndEnables: (profile: string) => string
+ installsOnly: (profile: string) => string
+ advanced: string
+ versionLabel: string
+ reviewedPin: (sha: string) => string
+ latestCommit: string
+ nothingToInstall: string
includesHeading: string
agentLabel: string
desktopLabel: string
profileLabel: string
agentTargetLocal: (profile: string, dir: string) => string
agentTargetRemote: (profile: string) => string
- catalogPinned: (name: string, sha: string) => string
- reviewedHeading: string
- reviewedIntro: string
toolsConnected: (n: number) => string
skillsReady: (names: string[]) => string
nextChat: string
@@ -657,12 +664,10 @@ export interface Translations extends NoticeTranslations {
desktopTargetFromPackage: string
desktopOnlyNote: string
insecureWarning: string
- securityHeading: string
securityIntro: string
sourceHeading: string
viewRepository: string
viewPluginFiles: string
- gitCloneLabel: string
enableAgent: string
forceReinstall: string
pinToCommit: string
diff --git a/apps/desktop/src/i18n/zh-hant_settings.ts b/apps/desktop/src/i18n/zh-hant_settings.ts
index 50bae8a8147..6f55c8ab74a 100644
--- a/apps/desktop/src/i18n/zh-hant_settings.ts
+++ b/apps/desktop/src/i18n/zh-hant_settings.ts
@@ -77,7 +77,17 @@ export const zhHantSettings = {
toolsConnected: n => `已連線 ${n} 個工具`,
skillsReady: names => (names.length === 1 ? `技能 ${names[0]} 已就緒` : `${names.length} 個技能已就緒`),
nextChat: '更多工具將在下一次聊天中可用',
- serverNotConnected: (server, reason) => `MCP 伺服器 ${server} 未連線${reason ? `:${reason}` : '。'}`
+ serverNotConnected: (server, reason) => `MCP 伺服器 ${server} 未連線${reason ? `:${reason}` : '。'}`,
+ verified: '已驗證',
+ unverified: '未驗證',
+ reviewedByNous: '已由 Nous 審核。',
+ installsAndEnables: profile => `安裝到 ${profile},並立即啟用。`,
+ installsOnly: profile => `安裝到 ${profile}。`,
+ advanced: '進階',
+ versionLabel: '版本',
+ reviewedPin: sha => (sha ? `已審核的固定提交 ${sha}` : '已審核的固定提交'),
+ latestCommit: '最新提交',
+ nothingToInstall: '此套件在這裡沒有可安裝的內容。'
}
},
closeSettings: '關閉設定',
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 91c2d51dde0..d2db20444e4 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -629,10 +629,6 @@ export const zhOverrides = {
profileLabel: '安装到配置文件',
agentTargetLocal: (profile, dir) => `安装到 ${profile} 后端(${dir})`,
agentTargetRemote: profile => `安装到已连接的 ${profile} 后端`,
- catalogPinned: (name, sha) =>
- `Hermes 目录条目「${name}」— agent 部分将安装在经过审核的固定提交${sha ? ` ${sha}` : ''},而不是分支最新代码。`,
- reviewedHeading: '经过审核的目录条目',
- reviewedIntro: '此条目已在其固定提交处经过人工审核。你仍可在下方检查确切代码。',
toolsConnected: n => `已连接 ${n} 个工具`,
skillsReady: names => (names.length === 1 ? `技能 ${names[0]} 已就绪` : `${names.length} 个技能已就绪`),
nextChat: '更多工具将在下一次聊天中可用',
@@ -643,12 +639,10 @@ export const zhOverrides = {
desktopTargetFromPackage: '从上方的包加载到本应用 — 所有配置相同',
desktopOnlyNote: '仅桌面包不会安装后端智能体插件。',
insecureWarning: '此 URL 使用了不安全的本地 scheme。生产环境请优先使用 https:// 或 git@。',
- securityHeading: '安装前须知',
securityIntro: '请仅安装你信任的来源 — 如需了解将添加的内容,可先查看下方仓库。',
sourceHeading: '源代码',
viewRepository: '查看仓库',
viewPluginFiles: '查看插件文件',
- gitCloneLabel: 'Git 克隆地址',
enableAgent: '安装后启用智能体插件',
forceReinstall: '强制重装(替换已存在的安装)',
pinToCommit: '固定到提交(可选)',
@@ -667,7 +661,17 @@ export const zhOverrides = {
agentFailed: '智能体插件安装失败',
installUncertain: 'Hermes 已停止等待安装结果,但插件可能仍在安装。关闭此窗口并刷新插件列表,然后再尝试安装。',
desktopFailed: '桌面插件安装失败',
- missingEnv: (_name, vars) => `缺少环境变量:${vars}。请在设置 → 密钥中添加。`
+ missingEnv: (_name, vars) => `缺少环境变量:${vars}。请在设置 → 密钥中添加。`,
+ verified: '已验证',
+ unverified: '未验证',
+ reviewedByNous: '已由 Nous 审核。',
+ installsAndEnables: profile => `安装到 ${profile},并立即启用。`,
+ installsOnly: profile => `安装到 ${profile}。`,
+ advanced: '高级',
+ versionLabel: '版本',
+ reviewedPin: sha => (sha ? `已审核的固定提交 ${sha}` : '已审核的固定提交'),
+ latestCommit: '最新提交',
+ nothingToInstall: '此包在这里没有可安装的内容。'
}
},
notifications: {
diff --git a/apps/desktop/src/lib/plugin-catalog.ts b/apps/desktop/src/lib/plugin-catalog.ts
index 2a691feba55..a57c3815193 100644
--- a/apps/desktop/src/lib/plugin-catalog.ts
+++ b/apps/desktop/src/lib/plugin-catalog.ts
@@ -45,6 +45,8 @@ export interface PluginCatalogEntry {
sha?: string
/** Sub-directory of a monorepo the plugin lives in; empty when the repo root is the plugin. */
subdir?: string
+ /** The description's first sentence: what the plugin does, in one line. */
+ summary?: string
}
export type PluginCatalogLookupError = 'invalid_name' | 'unavailable' | 'unknown'
@@ -52,6 +54,14 @@ export type PluginCatalogLookupError = 'invalid_name' | 'unavailable' | 'unknown
export type PluginCatalogLookup =
{ ok: false; error: PluginCatalogLookupError } | { ok: true; entry: PluginCatalogEntry }
+/** Mirrors `plugin_catalog_presence._first_sentence`, so the dialog and the setup card agree. */
+function firstSentence(text: string): string | undefined {
+ const flat = text.split(/\s+/).filter(Boolean).join(' ')
+ const end = flat.indexOf('. ')
+
+ return (end >= 0 ? flat.slice(0, end + 1) : flat) || undefined
+}
+
function asEntry(raw: unknown): null | PluginCatalogEntry {
if (!raw || typeof raw !== 'object') {
return null
@@ -67,7 +77,8 @@ function asEntry(raw: unknown): null | PluginCatalogEntry {
name: row.name,
repo: row.repo,
sha: typeof row.sha === 'string' && row.sha ? row.sha : undefined,
- subdir: typeof row.subdir === 'string' && row.subdir ? row.subdir : undefined
+ subdir: typeof row.subdir === 'string' && row.subdir ? row.subdir : undefined,
+ summary: typeof row.description === 'string' ? firstSentence(row.description) : undefined
}
}
diff --git a/apps/desktop/src/store/plugin-catalog-install.test.ts b/apps/desktop/src/store/plugin-catalog-install.test.ts
index 2b5f773b54f..6a63330448a 100644
--- a/apps/desktop/src/store/plugin-catalog-install.test.ts
+++ b/apps/desktop/src/store/plugin-catalog-install.test.ts
@@ -60,7 +60,13 @@ describe('requestPluginCatalogInstallFromDeepLink', () => {
it('falls back to the live catalog feed on a backend without the lookup, and rejects unknown names', async () => {
const feed = JSON.stringify([
- { name: 'weather', repo: 'https://github.com/x/weather', sha: 'a'.repeat(40), subdir: '' }
+ {
+ name: 'weather',
+ repo: 'https://github.com/x/weather',
+ sha: 'a'.repeat(40),
+ subdir: '',
+ description: 'Shows the weather\nfor a city. Disclosure — calls a public API.'
+ }
])
const fetchSpy = vi.spyOn(globalThis, 'fetch').mockImplementation(async () => new Response(feed, { status: 200 }))
@@ -80,7 +86,12 @@ describe('requestPluginCatalogInstallFromDeepLink', () => {
await requestPluginCatalogInstallFromDeepLink('weather', lookup)
- expect($pluginInstallRequest.get()).toMatchObject({ catalogName: 'weather', repo: 'https://github.com/x/weather' })
+ // The dialog's one line is the description's first sentence, never its disclosure.
+ expect($pluginInstallRequest.get()).toMatchObject({
+ catalogName: 'weather',
+ repo: 'https://github.com/x/weather',
+ summary: 'Shows the weather for a city.'
+ })
})
})
diff --git a/apps/desktop/src/store/plugin-catalog-install.ts b/apps/desktop/src/store/plugin-catalog-install.ts
index 7a998f98669..8d53b916480 100644
--- a/apps/desktop/src/store/plugin-catalog-install.ts
+++ b/apps/desktop/src/store/plugin-catalog-install.ts
@@ -15,7 +15,7 @@ import { openPluginInstallRequest, type PluginInstallRequest } from './plugin-in
export function openCatalogPluginInstall(
entry: PluginCatalogEntry,
profile: null | string,
- options: Pick<PluginInstallRequest, 'stayAfterInstall'> = {}
+ options: Pick<PluginInstallRequest, 'stayAfterInstall' | 'title'> = {}
): void {
const existing = $agentPlugins.get().find(row => row.catalog_name === entry.name || row.name === entry.name)
@@ -30,6 +30,7 @@ export function openCatalogPluginInstall(
profile,
repo: entry.subdir ? `${entry.repo}#${entry.subdir}` : entry.repo,
sha: entry.sha,
+ summary: entry.summary,
...options
})
}
diff --git a/apps/desktop/src/store/plugin-install-request.ts b/apps/desktop/src/store/plugin-install-request.ts
index 1c51edf04b9..9048d7bfb5b 100644
--- a/apps/desktop/src/store/plugin-install-request.ts
+++ b/apps/desktop/src/store/plugin-install-request.ts
@@ -15,6 +15,10 @@ export interface PluginInstallRequest {
catalogName?: string
/** The catalog pin (display only — the backend resolves it itself). */
sha?: string
+ /** Display name for the dialog heading (the catalog card's title); falls back to the catalog name. */
+ title?: string
+ /** One line on what the plugin does (the catalog description's first sentence). */
+ summary?: string
/** Capabilities profile scope the pick was made under; the agent half
* installs into THIS profile (null/undefined = active profile). */
profile?: string | null
diff --git a/website/docs/user-guide/features/plugin-catalog.md b/website/docs/user-guide/features/plugin-catalog.md
index 6f90887b004..ff17d0b2361 100644
--- a/website/docs/user-guide/features/plugin-catalog.md
+++ b/website/docs/user-guide/features/plugin-catalog.md
@@ -159,7 +159,7 @@ hermes plugins enable touchdesigner # same as: hermes plugins enable td
In the Desktop app a package with both an agent half and a Desktop half
(`desktop/plugin.js`) is one row with one switch per half. Turning the
-package on (the install dialog's **Enable agent plugin after install**, or
+package on (installing it from the install dialog, which turns it on, or
the row's **Agent** switch) turns its Desktop half on as well, unless you
switched that half off yourself. Turning it off stays per half, because the
Desktop half is shared by every profile.