The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): localize bot scheduling and advanced settings
brooklyn!d9d970ba0f27
diff --git a/apps/desktop/src/i18n/bots-advanced.test.tsx b/apps/desktop/src/i18n/bots-advanced.test.tsxnew file mode 100644index 00000000000..707bda2250a--- /dev/null+++ b/apps/desktop/src/i18n/bots-advanced.test.tsx@@ -0,0 +1,130 @@+import type * as HermesSdk from '@hermes/plugin-sdk'+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'+import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'+import { useState } from 'react'+import { afterEach, expect, it, vi } from 'vitest'++import { I18nProvider, useI18n } from '@/i18n'+import type { I18nContextValue } from '@/i18n'+import { registerPluginLocales } from '@/i18n/plugin-i18n'+import { BOTS_LOCALES } from '@/plugins/hermes-bots/i18n'+import { translateBotsIn } from '@/plugins/hermes-bots/i18n-test-helper'+import { McpSetupButton } from '@/plugins/hermes-bots/mcp-setup'+import { AdvancedProfileConfig, applyAdvancedConfig, emptyAdvancedState } from '@/plugins/hermes-bots/profile-config'++const mocks = vi.hoisted(() => ({+ request: vi.fn(async (method: string, _params?: Record<string, unknown>): Promise<unknown> => {+ if (method === 'profiles.describe') {+ return {+ soul: 'My English persona',+ model: { provider: 'my-provider', default: 'my-model' },+ skills: [{ name: 'my-skill', enabled: true }],+ toolsets: [{ name: 'my-tools', enabled: true }],+ mcp_servers: [{ name: 'my-mcp', enabled: true }]+ }+ }++ if (method === 'skills.manage') {+ return { results: [{ name: 'user-skill', description: 'English description from the server' }] }+ }++ if (method === 'profiles.configure') {+ return { applied: { skills: true } }+ }++ return {}+ }),+ notify: vi.fn()+}))++vi.mock('@hermes/plugin-sdk', async importOriginal => {+ const sdk = await importOriginal<typeof HermesSdk>()++ return {+ ...sdk,+ CapabilitiesView: undefined,+ ConnectorsTab: undefined,+ ToolsetConfigPanel: undefined,+ host: { ...sdk.host, request: mocks.request, notify: mocks.notify }+ }+})+let i18n: I18nContextValue+let dispose: () => void++function Controls() {+ i18n = useI18n()++ return null+}++function mount(children: React.ReactNode) {+ dispose = registerPluginLocales('hermes-bots', BOTS_LOCALES)++ return render(+ <I18nProvider configClient={null} initialLocale="zh">+ <QueryClientProvider client={new QueryClient({ defaultOptions: { queries: { retry: false } } })}>+ <Controls />+ {children}+ </QueryClientProvider>+ </I18nProvider>+ )+}++const bot = { name: 'writer' }++function Editor() {+ const [state, setState] = useState(emptyAdvancedState)++ return (+ <>+ <AdvancedProfileConfig bot={bot} setState={setState} state={state} />+ <button onClick={() => void applyAdvancedConfig(bot, state)}>Persist fixture</button>+ </>+ )+}++afterEach(() => {+ cleanup()+ dispose()+ vi.clearAllMocks()+})+it('localizes the advanced editor and hub without translating capability IDs or user data', async () => {+ mount(<Editor />)+ const zh = translateBotsIn('zh')+ expect(await screen.findByText(zh('editor.editSoul'))).toBeTruthy()+ expect(screen.getByText(zh('editor.skillsEnabled', 1, 1))).toBeTruthy()+ expect(await screen.findByText(i18n.t.settings.model.provider)).toBeTruthy()+ fireEvent.click(screen.getByRole('checkbox', { name: 'my-skill' }))+ fireEvent.change(screen.getByPlaceholderText(zh('tools.searchHub')), { target: { value: 'my query' } })+ await act(() => i18n.setLocale('ja'))+ const ja = translateBotsIn('ja')+ expect(screen.getByText(ja('editor.skillsEnabled', 0, 1))).toBeTruthy()++ for (const value of ['My English persona', 'my-provider', 'my-model', 'my query']) {+ expect(screen.getByDisplayValue(value)).toBeTruthy()+ }++ fireEvent.click(screen.getByRole('button', { name: i18n.t.skills.hub.search }))+ expect(await screen.findByText('English description from the server')).toBeTruthy()+ expect(screen.getByRole('button', { name: ja('tools.installHint', 'user-skill') })).toBeTruthy()+ fireEvent.click(screen.getByRole('button', { name: 'Persist fixture' }))+ await waitFor(() =>+ expect(mocks.request).toHaveBeenCalledWith('profiles.configure', { name: 'writer', disabled_skills: ['my-skill'] })+ )+})+it('localizes MCP setup actions while retaining the profile, preset and environment identifiers', async () => {+ mount(+ <McpSetupButton entry={{ name: 'my-server', requires: ['MY_SERVER_TOKEN'], fromCatalog: true }} profile="writer" />+ )+ const zh = translateBotsIn('zh')+ fireEvent.click(await screen.findByRole('button', { name: zh('tools.setUp') }))+ expect(await screen.findByPlaceholderText('MY_SERVER_TOKEN')).toBeTruthy()+ await act(() => i18n.setLocale('zh-hant'))+ expect(screen.getByRole('button', { name: translateBotsIn('zh-hant')('tools.saveTest') })).toBeTruthy()+ expect(mocks.request).toHaveBeenCalledWith('mcp.servers.add', {+ profile: 'writer',+ name: 'my-server',+ preset: 'my-server'+ })+ expect(mocks.request.mock.calls.some(([method]) => method === 'mcp.servers.set_api_key')).toBe(false)+})diff --git a/apps/desktop/src/i18n/bots-cron.test.tsx b/apps/desktop/src/i18n/bots-cron.test.tsxnew file mode 100644index 00000000000..b6bae84aae4--- /dev/null+++ b/apps/desktop/src/i18n/bots-cron.test.tsx@@ -0,0 +1,128 @@+import type * as HermesSdk from '@hermes/plugin-sdk'+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'+import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'+import { afterEach, beforeAll, expect, it, vi } from 'vitest'++import { I18nProvider, useI18n } from '@/i18n'+import type { I18nContextValue } from '@/i18n'+import { registerPluginLocales } from '@/i18n/plugin-i18n'+import { CreateRoutineDialog, RoutineDetailDialog } from '@/plugins/hermes-bots/cron'+import { BOTS_LOCALES } from '@/plugins/hermes-bots/i18n'+import { translateBotsIn } from '@/plugins/hermes-bots/i18n-test-helper'++const { request } = vi.hoisted(() => ({+ request: vi.fn(async (_method: string, _params?: Record<string, unknown>) => ({}))+}))++vi.mock('@hermes/plugin-sdk', async importOriginal => {+ const sdk = await importOriginal<typeof HermesSdk>()++ return { ...sdk, host: { ...sdk.host, request, notify: vi.fn() } }+})+// The bot desktop preview is outside the scheduling dialog under test.+vi.mock('@/plugins/hermes-bots/screen-hero', () => ({ ScreenHero: () => null }))+let i18n: I18nContextValue+let dispose: () => void++function Controls() {+ i18n = useI18n()++ return null+}++function mount(children: React.ReactNode) {+ dispose = registerPluginLocales('hermes-bots', BOTS_LOCALES)++ return render(+ <I18nProvider configClient={null} initialLocale="zh">+ <QueryClientProvider client={new QueryClient({ defaultOptions: { queries: { retry: false } } })}>+ <Controls />+ {children}+ </QueryClientProvider>+ </I18nProvider>+ )+}++beforeAll(() => {+ Element.prototype.scrollIntoView = vi.fn()+ Element.prototype.hasPointerCapture = vi.fn(() => false)+ Element.prototype.releasePointerCapture = vi.fn()+})+afterEach(() => {+ cleanup()+ dispose()+ vi.clearAllMocks()+})+it('switches scheduling copy without changing a staged schedule or user instruction', async () => {+ mount(<CreateRoutineDialog bot="writer" onClose={() => undefined} open />)+ const zh = translateBotsIn('zh')+ expect(screen.getByText(zh('cron.stopAfter'))).toBeTruthy()+ fireEvent.change(screen.getByPlaceholderText(i18n.t.cron.namePlaceholder), { target: { value: 'My digest' } })+ fireEvent.change(screen.getByPlaceholderText(i18n.t.cron.promptPlaceholder), {+ target: { value: 'Keep my English instruction.' }+ })+ fireEvent.change(screen.getByPlaceholderText(i18n.t.cron.namePlaceholder), { target: { value: 'bad\0name' } })+ fireEvent.click(screen.getByRole('button', { name: i18n.t.cron.createAction }))+ expect(await screen.findByText(zh('cron.nameNul'))).toBeTruthy()+ expect(request).not.toHaveBeenCalled()+ fireEvent.change(screen.getByPlaceholderText(i18n.t.cron.namePlaceholder), { target: { value: 'My digest' } })+ fireEvent.change(screen.getByPlaceholderText('∞'), { target: { value: '3' } })+ fireEvent.click(screen.getAllByRole('combobox')[0])+ fireEvent.click(screen.getByRole('option', { name: zh('cron.freqOnce') }))+ expect(screen.getByText(zh('cron.minutesFromNow'))).toBeTruthy()+ await act(() => i18n.setLocale('ja'))+ const ja = translateBotsIn('ja')+ expect(screen.getByText(ja('cron.minutesFromNow'))).toBeTruthy()+ fireEvent.click(screen.getAllByRole('combobox')[0])+ fireEvent.click(screen.getByRole('option', { name: ja('cron.freqDaily') }))+ expect(screen.getByDisplayValue('3')).toBeTruthy()+ expect(screen.getByText(ja('cron.stopAfter'))).toBeTruthy()+ expect(screen.getAllByRole('combobox')[1].textContent).toBe(+ new Intl.DateTimeFormat('ja', { hour: 'numeric', minute: '2-digit' }).format(new Date(2000, 0, 1, 9, 0))+ )+ fireEvent.click(screen.getByRole('button', { name: i18n.t.cron.createAction }))+ await waitFor(() =>+ expect(request).toHaveBeenCalledWith(+ 'cron.manage',+ expect.objectContaining({+ action: 'add',+ name: '[bot:writer] My digest',+ schedule: '0 9 * * *',+ repeat: 3,+ profile: 'writer'+ })+ )+ )+ expect(request.mock.calls.find(([method]) => method === 'cron.manage')?.[1]).toEqual(+ expect.objectContaining({ prompt: expect.stringContaining('Keep my English instruction.') })+ )+})+it('localizes inspector chrome and known states while preserving job data and unknown status', async () => {+ mount(+ <RoutineDetailDialog+ job={{+ job_id: 'job-1',+ name: '[bot:writer] User title',+ prompt_preview: 'User instruction',+ schedule: '0 9 * * 1-5',+ deliver: 'bot-chat',+ model: 'provider/model',+ workdir: '/my/work',+ last_status: 'delivery_failed'+ }}+ onClose={() => undefined}+ open+ />+ )+ const zh = translateBotsIn('zh')+ expect(screen.getByText(zh('cron.detailDescription'))).toBeTruthy()+ expect(screen.getByText(zh('cron.deliveryFailed'))).toBeTruthy()+ await act(() => i18n.setLocale('zh-hant'))+ expect(screen.getByText(translateBotsIn('zh-hant')('cron.deliveryFailed'))).toBeTruthy()++ for (const value of ['User title', 'User instruction', '0 9 * * 1-5', 'bot-chat', 'provider/model', '/my/work']) {+ expect(screen.getByText(value)).toBeTruthy()+ }++ expect(request).not.toHaveBeenCalled()+})diff --git a/apps/desktop/src/plugins/hermes-bots/cron-detail.test.tsx b/apps/desktop/src/plugins/hermes-bots/cron-detail.test.tsxindex 1f3ffc90a35..2e8a7fb5927 100644--- a/apps/desktop/src/plugins/hermes-bots/cron-detail.test.tsx+++ b/apps/desktop/src/plugins/hermes-bots/cron-detail.test.tsx@@ -11,6 +11,7 @@ import type * as HermesSdk from '@hermes/plugin-sdk'import { cleanup, render, screen, within } from '@testing-library/react'import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest'+import { translateBots } from './i18n-test-helper'import type { RoutineJob } from './types'// Radix calls these on open; jsdom doesn't implement them.@@ -20,12 +21,12 @@ beforeAll(() => {Element.prototype.releasePointerCapture = vi.fn()})-const request = vi.fn(async () => ({}))+const { request } = vi.hoisted(() => ({ request: vi.fn(async () => ({})) }))vi.mock('@hermes/plugin-sdk', async importOriginal => {const sdk = await importOriginal<typeof HermesSdk>()- return { ...sdk, host: { ...sdk.host, request } }+ return { ...sdk, usePluginI18n: () => translateBots, host: { ...sdk.host, request } }})const { RoutineDetailDialog, RoutineRow, routineDetailIssue, routineDetailRows } = await import('./cron')diff --git a/apps/desktop/src/plugins/hermes-bots/cron.tsx b/apps/desktop/src/plugins/hermes-bots/cron.tsxindex 9cdc1a7e463..9f40b761173 100644--- a/apps/desktop/src/plugins/hermes-bots/cron.tsx+++ b/apps/desktop/src/plugins/hermes-bots/cron.tsx@@ -43,7 +43,7 @@ import { avatarColor, botAppearance, BotFace } from './avatar'import { $focusedBotOwner, $selectedBot, focusedRosterOwner } from './bot-state'import { $botMeta, $lastRoster, botHandle, botRosterKey, botSelectionKey, isActiveRosterBot } from './data'import { labeled } from './dialog-parts'-import { botsText, useBots } from './i18n'+import { botsText, type BotsText, useBots } from './i18n'import { displayName } from './labels'import { botConnectionRoute, botRosterMeta, requestForBot } from './routing'import { ScreenHero } from './screen-hero'@@ -92,8 +92,8 @@ function routineBot(job: RoutineJob | null | undefined): null | string {return match ? match[1].toLowerCase() : null}-function routineTitle(job: RoutineJob | null | undefined): string {- return (job?.name || '').replace(BOT_TAG_RE, '') || 'Untitled job'+function routineTitle(job: RoutineJob | null | undefined, c: BotsText['cron']): string {+ return (job?.name || '').replace(BOT_TAG_RE, '') || c.untitled}export function isLegacyDelegatedRoutine(job: RoutineJob | null | undefined): boolean {@@ -257,13 +257,13 @@ function shellQuote(value: unknown): string {return `'${String(value).replaceAll("'", "'\"'\"'")}'`}-export function routineInputError(title: string, instruction: string): null | string {+export function routineInputError(title: string, instruction: string, c = botsText().cron): null | string {if (String(title).includes('\0')) {- return 'Job name cannot contain NUL (U+0000).'+ return c.nameNul}if (String(instruction).includes('\0')) {- return 'Job instruction cannot contain NUL (U+0000).'+ return c.instructionNul}return null@@ -338,7 +338,7 @@ function routineTimestamp(value: string | undefined): null | string {* unknown one is passed through verbatim rather than hidden. `delivery_failed`* means the agent run succeeded but the brief never reached its target; it* must read as a failure, not as a run result the user can trust. */-export function routineLastResult(status: string | null | undefined): null | string {+export function routineLastResult(status: string | null | undefined, c = botsText().cron): null | string {const raw = String(status || '').trim()if (!raw) {@@ -347,16 +347,16 @@ export function routineLastResult(status: string | null | undefined): null | strswitch (raw) {case 'ok':- return 'Succeeded'+ return c.succeededcase 'error':- return 'Failed'+ return c.failedcase 'delivery_failed':- return 'Ran, but delivery failed'+ return c.deliveryFailedcase 'blocked_config':- return 'Blocked by configuration (not run)'+ return c.blockedConfigdefault:return raw@@ -367,7 +367,10 @@ export function routineLastResult(status: string | null | undefined): null | str* rows. Pure so the detail contract is testable without a renderer, and so* the dialog cannot invent a field the gateway never sent: an absent value* drops its row instead of rendering "undefined". */-export function routineDetailRows(job: RoutineJob | null | undefined): Array<{ label: string; value: string }> {+export function routineDetailRows(+ job: RoutineJob | null | undefined,+ c = botsText().cron+): Array<{ label: string; value: string }> {const paused = job?.enabled === false || job?.state === 'paused'const label = scheduleLabel(job?.schedule)const raw = String(job?.schedule || '').trim()@@ -377,23 +380,23 @@ export function routineDetailRows(job: RoutineJob | null | undefined): Array<{ l// that narrowing into the map, so the rows are typed as filtered.return ([- ['Status', paused ? 'Paused' : 'Active'],- ['Schedule', label],+ [c.status, paused ? c.paused : c.active],+ [c.schedule, label],// `scheduleLabel` humanizes "every 1440m" and cron expressions; keep the// raw string when it says something the label dropped.- ['Schedule (raw)', raw && raw !== label ? raw : null],- ['Repeat', job?.repeat],+ [c.rawSchedule, raw && raw !== label ? raw : null],+ [c.repeat, job?.repeat],// A slot parked past the scheduler grace is labelled overdue, never// promised as a next run (#114309); the card below makes the same call.[- job && nextRunOverdueMs(job) !== null ? 'Overdue since' : 'Next run',+ job && nextRunOverdueMs(job) !== null ? c.overdueSince : c.nextRun,paused ? null : routineTimestamp(job?.next_run_at)],- ['Last run', routineTimestamp(job?.last_run_at)],- ['Last result', routineLastResult(job?.last_status)],- ['Delivers to', job?.deliver],- ['Model', job?.model],- ['Working directory', job?.workdir]+ [c.lastRun, routineTimestamp(job?.last_run_at)],+ [c.lastResult, routineLastResult(job?.last_status, c)],+ [translateNow('cron.deliverLabel'), job?.deliver],+ [translateNow('cron.modelLabel'), job?.model],+ [c.workdir, job?.workdir]] as Array<[string, string]>).filter(([, value]) => typeof value === 'string' && value.trim())@@ -425,7 +428,7 @@ interface RoutineDetailDialogProps {export function RoutineDetailDialog({ job, onClose, open }: RoutineDetailDialogProps) {const b = useBots()const { t } = useI18n()- const rows = job ? routineDetailRows(job) : []+ const rows = job ? routineDetailRows(job, b.cron) : []const issue = job ? routineDetailIssue(job) : nullconst instruction = String(job?.prompt_preview || '').trim()@@ -440,8 +443,8 @@ export function RoutineDetailDialog({ job, onClose, open }: RoutineDetailDialogP><DialogContent className="max-w-md"><DialogHeader>- <DialogTitle className="truncate">{routineTitle(job)}</DialogTitle>- <DialogDescription>What this job runs, and when it runs next.</DialogDescription>+ <DialogTitle className="truncate">{routineTitle(job, b.cron)}</DialogTitle>+ <DialogDescription>{b.cron.detailDescription}</DialogDescription></DialogHeader><div className="grid gap-3.5">{issue ? (@@ -485,6 +488,7 @@ interface RoutineRowProps {}export function RoutineRow({ job, onOpen, owner }: RoutineRowProps) {+ const b = useBots()const { t } = useI18n()const c = t.cronconst profile = typeof owner === 'string' ? owner : owner?.name@@ -560,7 +564,7 @@ export function RoutineRow({ job, onOpen, owner }: RoutineRowProps) {className={cn('size-1.5 shrink-0 rounded-full', active ? 'bg-(--ui-success)' : 'bg-(--ui-text-quaternary)')}/><span className={cn('min-w-0 flex-1 truncate text-xs font-medium', !active && 'text-(--ui-text-tertiary)')}>- {routineTitle(job)}+ {routineTitle(job, b.cron)}</span></RowButton><Switch@@ -597,7 +601,7 @@ export function RoutineRow({ job, onOpen, owner }: RoutineRowProps) {</div>{legacyUnsafe ? (<div className="rounded-md border border-(--ui-stroke-secondary) px-2 py-1.5 text-[0.65rem] leading-4 text-(--ui-accent)">- Paused for security: delete and recreate this legacy job before running it again.+ {b.cron.legacyUnsafe}</div>) : null}</div>@@ -626,9 +630,7 @@ interface ScheduleState {/** Built per call, not frozen at module load: the labels are translated, and* a module const would pin whichever locale happened to be active at import. */-function frequencies(): Array<{ id: ScheduleFreq; label: string }> {- const c = botsText().cron-+function frequencies(c: BotsText['cron']): Array<{ id: ScheduleFreq; label: string }> {return [{ id: 'once', label: c.freqOnce },{ id: 'hourly', label: c.freqHourly },@@ -652,11 +654,8 @@ const TIMES = (() => {for (let h = 0; h < 24; h++) {for (const m of [0, 30]) {- const ampm = h < 12 ? 'AM' : 'PM'- const h12 = h % 12 === 0 ? 12 : h % 12out.push({id: `${h}:${m}`,- label: `${h12}:${String(m).padStart(2, '0')} ${ampm}`,h,m})@@ -702,10 +701,7 @@ function composeSchedule(state: ScheduleState): string {}}-function scheduleSummary(state: ScheduleState): string {- const c = botsText().cron- const t = TIMES.find(x => x.id === state.time)- const tl = t ? t.label : '9:00 AM'+function scheduleSummary(state: ScheduleState, c: BotsText['cron'], tl: string): string {const unitWord = (u: string) => (u === 'm' ? c.unitMinutes : u === 'd' ? c.unitDays : c.unitHours)const cap =@@ -770,6 +766,10 @@ interface SchedulePickerProps {function SchedulePicker({ state, setState }: SchedulePickerProps) {const b = useBots()+ const { locale } = useI18n()+ const clock = new Intl.DateTimeFormat(locale, { hour: 'numeric', minute: '2-digit' })+ const times = TIMES.map(time => ({ ...time, label: clock.format(new Date(2000, 0, 1, time.h, time.m)) }))+ const timeLabel = times.find(time => time.id === state.time)?.label ?? clock.format(new Date(2000, 0, 1, 9, 0))const upd = (patch: Partial<ScheduleState>) =>setState(prev => ({@@ -788,7 +788,7 @@ function SchedulePicker({ state, setState }: SchedulePickerProps) {upd({freq: v}),- frequencies()+ frequencies(b.cron))}{needsTime? pickerSelect(@@ -797,7 +797,7 @@ function SchedulePicker({ state, setState }: SchedulePickerProps) {upd({time: v}),- TIMES+ times): null}</div>@@ -822,15 +822,15 @@ function SchedulePicker({ state, setState }: SchedulePickerProps) {[{id: 'm',- label: 'minutes from now'+ label: b.cron.minutesFromNow},{id: 'h',- label: 'hours from now'+ label: b.cron.hoursFromNow},{id: 'd',- label: 'days from now'+ label: b.cron.daysFromNow}])}@@ -882,15 +882,15 @@ function SchedulePicker({ state, setState }: SchedulePickerProps) {[{id: 'm',- label: 'minutes'+ label: b.cron.unitMinutes},{id: 'h',- label: 'hours'+ label: b.cron.unitHours},{id: 'd',- label: 'days'+ label: b.cron.unitDays}])}@@ -910,7 +910,7 @@ function SchedulePicker({ state, setState }: SchedulePickerProps) {) : null}{state.freq !== 'once' && state.freq !== 'advanced' ? (<div className="flex items-center gap-2">- <span className="text-xs text-(--ui-text-tertiary)">Stop after</span>+ <span className="text-xs text-(--ui-text-tertiary)">{b.cron.stopAfter}</span><InputclassName="h-7 w-16 text-xs"onChange={event =>@@ -921,10 +921,10 @@ function SchedulePicker({ state, setState }: SchedulePickerProps) {placeholder="∞"value={state.repeatN}/>- <span className="text-xs text-(--ui-text-tertiary)">runs (blank = forever)</span>+ <span className="text-xs text-(--ui-text-tertiary)">{b.cron.runsHint}</span></div>) : null}- <div className="text-[0.65rem] text-(--ui-text-quaternary)">{`${scheduleSummary(state)} \u00b7 ${composeSchedule(state) || '\u2014'}`}</div>+ <div className="text-[0.65rem] text-(--ui-text-quaternary)">{`${scheduleSummary(state, b.cron, timeLabel)} \u00b7 ${composeSchedule(state) || '\u2014'}`}</div></div>)}@@ -990,7 +990,7 @@ export function CreateRoutineDialog({ bot, open, onClose }: CreateRoutineDialogPconst submit = async () => {const title = name.trim()const task = instruction.trim()- const inputError = routineInputError(title, task)+ const inputError = routineInputError(title, task, b.cron)if (inputError) {setError(inputError)diff --git a/apps/desktop/src/plugins/hermes-bots/i18n.ts b/apps/desktop/src/plugins/hermes-bots/i18n.tsindex 255cc0310f3..878322e5f1d 100644--- a/apps/desktop/src/plugins/hermes-bots/i18n.ts+++ b/apps/desktop/src/plugins/hermes-bots/i18n.ts@@ -37,6 +37,21 @@ import { getPluginCtx } from './shared'type BotsMessages = {/** Left rail: the bot + group-chat roster. */editor: {+ fullConfigHint: string+ liveCapabilities: string+ editSoul: string+ remoteCapabilitiesHint: string+ skillsEnabled: (enabled: number, total: number) => string+ toolsetsEnabled: (enabled: number, total: number) => string+ mcpServers: string+ providerCustom: string+ modelCustom: string+ backToDropdowns: string+ inheritLaunch: string+ enterManually: string+ gatewayDefault: string+ modelNameExample: string+ modelSwitchFailed: stringnewDescription: stringname: stringtitle: string@@ -309,6 +324,26 @@ type BotsMessages = {}/** Skills hub + MCP setup surfaces embedded in the bot editor. */tools: {+ installHint: (name: string) => string+ installed: (name: string) => string+ installFailed: (name: string) => string+ searchHint: string+ resizeHint: string+ addServerFailed: string+ noTarget: string+ setKeyFailed: (name: string) => string+ configured: (name: string) => string+ authenticated: (name: string) => string+ testFailed: string+ completeSignIn: string+ needsSetup: (name: string) => string+ setUpDone: string+ saveTest: string+ authorizing: string+ working: string+ setupFailed: string+ signIn: string+ setUp: stringskillsHub: stringfilterSkills: stringsearchHub: string@@ -370,6 +405,31 @@ type BotsMessages = {/** Bot-scoped scheduled jobs. Generic scheduling chrome (weekday names,* Daily/Hourly, the job verbs) resolves against core's `cron` section. */cron: {+ untitled: string+ nameNul: string+ instructionNul: string+ minutesFromNow: string+ hoursFromNow: string+ daysFromNow: string+ stopAfter: string+ runsHint: string+ detailDescription: string+ status: string+ active: string+ paused: string+ schedule: string+ rawSchedule: string+ repeat: string+ nextRun: string+ overdueSince: string+ lastRun: string+ lastResult: string+ workdir: string+ succeeded: string+ failed: string+ deliveryFailed: string+ blockedConfig: string+ legacyUnsafe: stringfilterHint: stringneedsRosterFirst: stringstaleNotice: string@@ -413,6 +473,22 @@ type BotsMessages = {const en: BotsMessages = {editor: {+ fullConfigHint: 'Full configuration needs a newer gateway (restart it after updating Hermes).',+ liveCapabilities: 'Capabilities (applies immediately — skills, tools, MCP)',+ editSoul: 'SOUL.md (persona + agent-messaging protocol)',+ remoteCapabilitiesHint:+ 'Remote capabilities require a newer desktop. Model and SOUL changes remain staged until you save.',+ skillsEnabled: (enabled, total) => `Skills (${enabled}/${total} enabled)`,+ toolsetsEnabled: (enabled, total) => `Toolsets (${enabled}/${total} enabled — unchecking all restores the default)`,+ mcpServers: 'MCP servers',+ providerCustom: 'Provider (Custom)',+ modelCustom: 'Model (Custom)',+ backToDropdowns: '← Back to dropdowns',+ inheritLaunch: 'Inherit (launch profile)',+ enterManually: '✏️ Enter manually…',+ gatewayDefault: 'gateway default',+ modelNameExample: 'e.g. model name',+ modelSwitchFailed: 'Model switch failed',newDescription: 'A named teammate with its own memory, skills, and chat. It can message your other agents.',name: 'Name',title: 'Title',@@ -678,6 +754,26 @@ const en: BotsMessages = {answerTo: member => `Answer @${member}`},tools: {+ installHint: name => `Install "${name}" and add it to the list above`,+ installed: name => `Skill "${name}" installed`,+ installFailed: name => `Installing "${name}" failed`,+ searchHint: 'Searching community + well-known sources — can take ~10s…',+ resizeHint: 'Drag the corner to resize.',+ addServerFailed: 'Could not add server',+ noTarget: 'No target profile',+ setKeyFailed: key => `Failed to set ${key}`,+ configured: name => `${name} configured`,+ authenticated: name => `${name} authenticated`,+ testFailed: 'Server test failed after setup',+ completeSignIn: 'Complete sign-in in your browser...',+ needsSetup: keys => `needs setup (${keys}) — restart the gateway to enable in-app setup`,+ setUpDone: 'set up ✓',+ saveTest: 'Save & test',+ authorizing: 'Authorizing…',+ working: 'Working…',+ setupFailed: 'Setup failed',+ signIn: 'Sign in…',+ setUp: 'Set up…',skillsHub: 'Hermes Skills Hub',filterSkills: 'Filter skills…',searchHub: 'Search the hub (community + well-known sources)…',@@ -734,6 +830,31 @@ const en: BotsMessages = {controlTaken: 'Another viewer took control. Watching only.'},cron: {+ untitled: 'Untitled job',+ nameNul: 'Job name cannot contain NUL (U+0000).',+ instructionNul: 'Job instruction cannot contain NUL (U+0000).',+ minutesFromNow: 'minutes from now',+ hoursFromNow: 'hours from now',+ daysFromNow: 'days from now',+ stopAfter: 'Stop after',+ runsHint: 'runs (blank = forever)',+ detailDescription: 'What this job runs, and when it runs next.',+ status: 'Status',+ active: 'Active',+ paused: 'Paused',+ schedule: 'Schedule',+ rawSchedule: 'Schedule (raw)',+ repeat: 'Repeat',+ nextRun: 'Next run',+ overdueSince: 'Overdue since',+ lastRun: 'Last run',+ lastResult: 'Last result',+ workdir: 'Working directory',+ succeeded: 'Succeeded',+ failed: 'Failed',+ deliveryFailed: 'Ran, but delivery failed',+ blockedConfig: 'Blocked by configuration (not run)',+ legacyUnsafe: 'Paused for security: delete and recreate this legacy job before running it again.',filterHint:'Scheduled jobs exist in this profile but none are tagged for this bot. Name a job "[bot:<name>] …" to show it here, or see them in Cron below.',needsRosterFirst: 'This bot has to appear in the roster first.',@@ -776,6 +897,22 @@ const en: BotsMessages = {const ja: BotsMessages = {editor: {+ fullConfigHint: 'すべての設定を使うには新しいゲートウェイが必要です(Hermes 更新後に再起動してください)。',+ liveCapabilities: '機能(即時適用 — スキル、ツール、MCP)',+ editSoul: 'SOUL.md(人格 + エージェント間メッセージプロトコル)',+ remoteCapabilitiesHint:+ 'リモート機能には新しいデスクトップアプリが必要です。モデルと SOUL の変更は保存するまで適用されません。',+ skillsEnabled: (enabled, total) => `スキル(${enabled}/${total} 有効)`,+ toolsetsEnabled: (enabled, total) => `ツールセット(${enabled}/${total} 有効 — すべて解除すると既定値に戻ります)`,+ mcpServers: 'MCP サーバー',+ providerCustom: 'プロバイダー(カスタム)',+ modelCustom: 'モデル(カスタム)',+ backToDropdowns: '← 選択リストに戻る',+ inheritLaunch: '継承(起動プロファイル)',+ enterManually: '✏️ 手動入力…',+ gatewayDefault: 'ゲートウェイの既定値',+ modelNameExample: '例:モデル名',+ modelSwitchFailed: 'モデルの切り替えに失敗しました',newDescription:'独自のメモリ、スキル、チャットを持つ名前付きの仲間です。他のエージェントとメッセージをやり取りできます。',name: '名前',@@ -1042,6 +1179,26 @@ const ja: BotsMessages = {answerTo: member => `@${member}に回答`},tools: {+ installHint: name => `「${name}」をインストールして上の一覧に追加`,+ installed: name => `スキル「${name}」をインストールしました`,+ installFailed: name => `「${name}」のインストールに失敗しました`,+ searchHint: 'コミュニティと主要なソースを検索中 — 約 10 秒かかる場合があります…',+ resizeHint: '角をドラッグしてサイズを変更できます。',+ addServerFailed: 'サーバーを追加できませんでした',+ noTarget: '対象プロファイルがありません',+ setKeyFailed: key => `${key} の設定に失敗しました`,+ configured: name => `${name} を設定しました`,+ authenticated: name => `${name} の認証が完了しました`,+ testFailed: '設定後のサーバーテストに失敗しました',+ completeSignIn: 'ブラウザーでサインインを完了してください…',+ needsSetup: keys => `設定が必要(${keys})— アプリ内で設定するにはゲートウェイを再起動してください`,+ setUpDone: '設定済み ✓',+ saveTest: '保存してテスト',+ authorizing: '認証中…',+ working: '処理中…',+ setupFailed: '設定に失敗しました',+ signIn: 'サインイン…',+ setUp: '設定…',skillsHub: 'Hermes スキルハブ',filterSkills: 'スキルを絞り込み…',searchHub: 'ハブを検索(コミュニティと既知のソース)…',@@ -1101,6 +1258,31 @@ const ja: BotsMessages = {controlTaken: '別のビューアが操作を引き継ぎました。閲覧のみ。'},cron: {+ untitled: '無題のジョブ',+ nameNul: 'ジョブ名に NUL (U+0000) は使用できません。',+ instructionNul: 'ジョブの指示に NUL (U+0000) は使用できません。',+ minutesFromNow: '分後',+ hoursFromNow: '時間後',+ daysFromNow: '日後',+ stopAfter: '実行上限',+ runsHint: '回(空欄で無制限)',+ detailDescription: 'このジョブの実行内容と次回の実行日時。',+ status: '状態',+ active: '有効',+ paused: '一時停止',+ schedule: 'スケジュール',+ rawSchedule: 'スケジュール(元の値)',+ repeat: '繰り返し',+ nextRun: '次回実行',+ overdueSince: '実行予定超過',+ lastRun: '前回実行',+ lastResult: '前回の結果',+ workdir: '作業ディレクトリ',+ succeeded: '成功',+ failed: '失敗',+ deliveryFailed: '実行済みですが、配信に失敗しました',+ blockedConfig: '設定によりブロック(未実行)',+ legacyUnsafe: '安全のため一時停止中です。この旧形式のジョブを削除して作り直してから実行してください。',filterHint:'このプロファイルには定期実行ジョブがありますが、このボット向けのタグが付いたものはありません。ジョブ名を「[bot:<名前>] …」にするとここに表示されます。下のCronでも確認できます。',needsRosterFirst: 'このボットは先に名簿に表示される必要があります。',@@ -1143,6 +1325,21 @@ const ja: BotsMessages = {const zh: BotsMessages = {editor: {+ fullConfigHint: '完整配置需要更新网关(更新 Hermes 后请重启网关)。',+ liveCapabilities: '功能(立即生效 — 技能、工具、MCP)',+ editSoul: 'SOUL.md(人格 + 智能体消息协议)',+ remoteCapabilitiesHint: '远程功能需要更新桌面应用。模型和 SOUL 的更改会在保存后生效。',+ skillsEnabled: (enabled, total) => `技能(已启用 ${enabled}/${total})`,+ toolsetsEnabled: (enabled, total) => `工具集(已启用 ${enabled}/${total} — 全部取消勾选可恢复默认值)`,+ mcpServers: 'MCP 服务器',+ providerCustom: '提供商(自定义)',+ modelCustom: '模型(自定义)',+ backToDropdowns: '← 返回下拉选项',+ inheritLaunch: '继承(启动配置文件)',+ enterManually: '✏️ 手动输入…',+ gatewayDefault: '网关默认值',+ modelNameExample: '例如:模型名称',+ modelSwitchFailed: '模型切换失败',newDescription: '拥有独立记忆、技能和聊天的具名队友,可以与你的其他智能体互发消息。',name: '名称',title: '显示名称',@@ -1398,6 +1595,26 @@ const zh: BotsMessages = {answerTo: member => `回答 @${member}`},tools: {+ installHint: name => `安装“${name}”并添加到上方列表`,+ installed: name => `技能“${name}”已安装`,+ installFailed: name => `安装“${name}”失败`,+ searchHint: '正在搜索社区和常用来源 — 可能需要约 10 秒…',+ resizeHint: '拖动角落可调整大小。',+ addServerFailed: '无法添加服务器',+ noTarget: '没有目标配置文件',+ setKeyFailed: key => `无法设置 ${key}`,+ configured: name => `${name} 已配置`,+ authenticated: name => `${name} 已验证身份`,+ testFailed: '配置后的服务器测试失败',+ completeSignIn: '请在浏览器中完成登录…',+ needsSetup: keys => `需要设置(${keys})— 重启网关以启用应用内设置`,+ setUpDone: '已设置 ✓',+ saveTest: '保存并测试',+ authorizing: '正在授权…',+ working: '正在处理…',+ setupFailed: '设置失败',+ signIn: '登录…',+ setUp: '设置…',skillsHub: 'Hermes 技能中心',filterSkills: '筛选技能…',searchHub: '搜索技能中心(社区和常见来源)…',@@ -1454,6 +1671,31 @@ const zh: BotsMessages = {controlTaken: '另一位查看者已接管控制。仅可观看。'},cron: {+ untitled: '未命名任务',+ nameNul: '任务名称不能包含 NUL (U+0000)。',+ instructionNul: '任务指令不能包含 NUL (U+0000)。',+ minutesFromNow: '分钟后',+ hoursFromNow: '小时后',+ daysFromNow: '天后',+ stopAfter: '运行上限',+ runsHint: '次(留空则持续运行)',+ detailDescription: '此任务的内容和下次运行时间。',+ status: '状态',+ active: '运行中',+ paused: '已暂停',+ schedule: '计划',+ rawSchedule: '计划(原始值)',+ repeat: '重复',+ nextRun: '下次运行',+ overdueSince: '逾期起始时间',+ lastRun: '上次运行',+ lastResult: '上次结果',+ workdir: '工作目录',+ succeeded: '成功',+ failed: '失败',+ deliveryFailed: '已运行,但发送失败',+ blockedConfig: '配置阻止了运行(未执行)',+ legacyUnsafe: '为安全起见已暂停:请删除并重新创建此旧任务,然后再运行。',filterHint:'此配置档案中有定时任务,但没有一个标记给这个机器人。将任务命名为“[bot:<名称>] …”即可显示在这里,也可以在下方的 Cron 中查看。',needsRosterFirst: '这个机器人需要先出现在名册中。',@@ -1496,6 +1738,21 @@ const zh: BotsMessages = {const zhHant: BotsMessages = {editor: {+ fullConfigHint: '完整設定需要更新閘道(更新 Hermes 後請重新啟動閘道)。',+ liveCapabilities: '功能(立即生效 — 技能、工具、MCP)',+ editSoul: 'SOUL.md(人格 + 智慧代理訊息協定)',+ remoteCapabilitiesHint: '遠端功能需要更新桌面應用程式。模型和 SOUL 的變更會在儲存後生效。',+ skillsEnabled: (enabled, total) => `技能(已啟用 ${enabled}/${total})`,+ toolsetsEnabled: (enabled, total) => `工具集(已啟用 ${enabled}/${total} — 全部取消勾選可還原預設值)`,+ mcpServers: 'MCP 伺服器',+ providerCustom: '供應商(自訂)',+ modelCustom: '模型(自訂)',+ backToDropdowns: '← 返回下拉選項',+ inheritLaunch: '繼承(啟動設定檔)',+ enterManually: '✏️ 手動輸入…',+ gatewayDefault: '閘道預設值',+ modelNameExample: '例如:模型名稱',+ modelSwitchFailed: '模型切換失敗',newDescription: '擁有獨立記憶、技能和聊天的具名隊友,可以與你的其他智慧代理互傳訊息。',name: '名稱',title: '顯示名稱',@@ -1751,6 +2008,26 @@ const zhHant: BotsMessages = {answerTo: member => `回覆 @${member}`},tools: {+ installHint: name => `安裝「${name}」並新增至上方清單`,+ installed: name => `技能「${name}」已安裝`,+ installFailed: name => `安裝「${name}」失敗`,+ searchHint: '正在搜尋社群和常用來源 — 可能需要約 10 秒…',+ resizeHint: '拖曳角落可調整大小。',+ addServerFailed: '無法新增伺服器',+ noTarget: '沒有目標設定檔',+ setKeyFailed: key => `無法設定 ${key}`,+ configured: name => `${name} 已設定`,+ authenticated: name => `${name} 已驗證身分`,+ testFailed: '設定後的伺服器測試失敗',+ completeSignIn: '請在瀏覽器中完成登入…',+ needsSetup: keys => `需要設定(${keys})— 重新啟動閘道以啟用應用程式內設定`,+ setUpDone: '已設定 ✓',+ saveTest: '儲存並測試',+ authorizing: '正在授權…',+ working: '正在處理…',+ setupFailed: '設定失敗',+ signIn: '登入…',+ setUp: '設定…',skillsHub: 'Hermes 技能中心',filterSkills: '篩選技能…',searchHub: '搜尋技能中心(社群和常見來源)…',@@ -1807,6 +2084,31 @@ const zhHant: BotsMessages = {controlTaken: '另一位檢視者已接手控制。僅可觀看。'},cron: {+ untitled: '未命名工作',+ nameNul: '工作名稱不能包含 NUL (U+0000)。',+ instructionNul: '工作指令不能包含 NUL (U+0000)。',+ minutesFromNow: '分鐘後',+ hoursFromNow: '小時後',+ daysFromNow: '天後',+ stopAfter: '執行上限',+ runsHint: '次(留空則持續執行)',+ detailDescription: '此工作的內容和下次執行時間。',+ status: '狀態',+ active: '啟用中',+ paused: '已暫停',+ schedule: '排程',+ rawSchedule: '排程(原始值)',+ repeat: '重複',+ nextRun: '下次執行',+ overdueSince: '逾期起始時間',+ lastRun: '上次執行',+ lastResult: '上次結果',+ workdir: '工作目錄',+ succeeded: '成功',+ failed: '失敗',+ deliveryFailed: '已執行,但傳送失敗',+ blockedConfig: '設定阻止了執行(未執行)',+ legacyUnsafe: '基於安全考量已暫停:請刪除並重新建立此舊工作,然後再執行。',filterHint:'此設定檔中有排程工作,但沒有任何一個標記給這個機器人。將工作命名為「[bot:<名稱>] …」即可顯示在這裡,也可以在下方的 Cron 中查看。',needsRosterFirst: '這個機器人需要先出現在名冊中。',diff --git a/apps/desktop/src/plugins/hermes-bots/mcp-setup.tsx b/apps/desktop/src/plugins/hermes-bots/mcp-setup.tsxindex 896a5ecad4b..f4bf5e6fc60 100644--- a/apps/desktop/src/plugins/hermes-bots/mcp-setup.tsx+++ b/apps/desktop/src/plugins/hermes-bots/mcp-setup.tsx@@ -9,6 +9,8 @@import { Button, host, Input, useI18n } from '@hermes/plugin-sdk'import { useEffect, useRef, useState } from 'react'+import { useBots } from './i18n'+// -- inline MCP setup (per-profile), driven by the mcp.servers.* gateway RPCs --// Feature-detected: if the gateway predates those RPCs the setup button hides// and the row falls back to the "run hermes mcp / Settings" hint. profile is@@ -107,6 +109,7 @@ interface McpSetupButtonProps {export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSetupButtonProps) {const { t } = useI18n()+ const b = useBots()// entry: { name, requires:[env keys], auth?, fromCatalog, installed }// profile may be null at first (New Bot: the profile isn't created yet).// ensureProfile() lazily creates it on the first setup action and returns the@@ -181,7 +184,7 @@ export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSetif (!add.ok) {setPhase('error')- setMessage(add.error || 'Could not add server')+ setMessage(add.error || b.tools.addServerFailed)return}@@ -196,7 +199,7 @@ export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSetif (!target) {setPhase('error')- setMessage('No target profile')+ setMessage(b.tools.noTarget)return}@@ -217,7 +220,7 @@ export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSetif (!r.ok) {setPhase('error')- setMessage(r.error || 'Failed to set ' + k)+ setMessage(r.error || b.tools.setKeyFailed(k))return}@@ -233,14 +236,12 @@ export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSetsetPhase('done')host.notify({kind: 'success',- message: entry.name + ' configured'+ message: b.tools.configured(entry.name)})onDone && onDone()} else {setPhase('error')- setMessage(- (t.result && (t.result.error || (t.result.result && t.result.result.error))) || 'Server test failed after setup'- )+ setMessage((t.result && (t.result.error || (t.result.result && t.result.result.error))) || b.tools.testFailed)}}@@ -269,7 +270,7 @@ export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSettry {setPhase('oauth')- setMessage('Complete sign-in in your browser...')+ setMessage(b.tools.completeSignIn)await host.completeMcpOAuth({serverName: entry.name,profile: scope,@@ -282,7 +283,7 @@ export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSet}setPhase('done')- host.notify({ kind: 'success', message: entry.name + ' authenticated' })+ host.notify({ kind: 'success', message: b.tools.authenticated(entry.name) })onDone?.()} catch (error) {if (oauthEpoch.current !== epoch) {@@ -297,13 +298,13 @@ export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSetif (supported === false) {return (<span className="ml-1.5 text-[0.65rem] text-(--ui-text-quaternary)">- {'needs setup (' + requires.join(', ') + ') \u2014 restart the gateway to enable in-app setup'}+ {b.tools.needsSetup(requires.join(', '))}</span>)}if (phase === 'done') {- return <span className="ml-1.5 text-[0.65rem] text-(--ui-success)">set up ✓</span>+ return <span className="ml-1.5 text-[0.65rem] text-(--ui-success)">{b.tools.setUpDone}</span>}if (phase === 'keys') {@@ -326,7 +327,7 @@ export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSet))}<div className="flex gap-1"><Button onClick={() => void submitKeys()} size="xs" variant="secondary">- Save & test+ {b.tools.saveTest}</Button><Button onClick={() => setPhase('idle')} size="xs" variant="ghost">{t.common.cancel}@@ -337,19 +338,19 @@ export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSet}if (phase === 'oauth') {- return <span className="ml-1.5 text-[0.65rem] text-(--ui-text-quaternary)">{message || 'Authorizing\u2026'}</span>+ return <span className="ml-1.5 text-[0.65rem] text-(--ui-text-quaternary)">{message || b.tools.authorizing}</span>}if (phase === 'busy') {- return <span className="ml-1.5 text-[0.65rem] text-(--ui-text-quaternary)">Working…</span>+ return <span className="ml-1.5 text-[0.65rem] text-(--ui-text-quaternary)">{b.tools.working}</span>}if (phase === 'error') {return (<span className="ml-1.5 text-[0.65rem] text-(--ui-danger,#f87171)">- {(message || 'Setup failed') + ' '}+ {(message || b.tools.setupFailed) + ' '}<Button className="underline" onClick={() => setPhase('idle')} size="inline" variant="link">- retry+ {t.common.retry}</Button></span>)@@ -363,7 +364,7 @@ export function McpSetupButton({ profile, entry, onDone, ensureProfile }: McpSetsize="inline"variant="link">- {isOAuth ? 'Sign in\u2026' : 'Set up\u2026'}+ {isOAuth ? b.tools.signIn : b.tools.setUp}</Button>)}diff --git a/apps/desktop/src/plugins/hermes-bots/model-picker.test.tsx b/apps/desktop/src/plugins/hermes-bots/model-picker.test.tsxindex 8c88b61688a..aea6b7adf19 100644--- a/apps/desktop/src/plugins/hermes-bots/model-picker.test.tsx+++ b/apps/desktop/src/plugins/hermes-bots/model-picker.test.tsx@@ -18,11 +18,13 @@* dispatch at all for a row whose connection is gone.*/+import type * as HermesSdk from '@hermes/plugin-sdk'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { render, waitFor } from '@testing-library/react'import type { ReactNode } from 'react'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import { translateBots } from './i18n-test-helper'import { ModelPicker } from './model-picker'import type { RosterRow } from './types'@@ -36,6 +38,7 @@ const { hostMock } = vi.hoisted(() => ({vi.mock('@hermes/plugin-sdk', async () => {const { useQuery } = await import('@tanstack/react-query')+ const { useI18n } = await vi.importActual<typeof HermesSdk>('@hermes/plugin-sdk')return {Button: (props: React.ComponentProps<'button'>) => <button {...props} />,@@ -47,6 +50,8 @@ vi.mock('@hermes/plugin-sdk', async () => {SelectItem: ({ children }: { children: ReactNode }) => <div>{children}</div>,SelectTrigger: ({ children }: { children: ReactNode }) => <div>{children}</div>,SelectValue: () => null,+ useI18n,+ usePluginI18n: () => translateBots,useQuery}})diff --git a/apps/desktop/src/plugins/hermes-bots/model-picker.tsx b/apps/desktop/src/plugins/hermes-bots/model-picker.tsxindex ecebdbb9ea4..7ee5a5d05d4 100644--- a/apps/desktop/src/plugins/hermes-bots/model-picker.tsx+++ b/apps/desktop/src/plugins/hermes-bots/model-picker.tsx@@ -15,11 +15,13 @@ import {SelectItem,SelectTrigger,SelectValue,+ useI18n,useQuery} from '@hermes/plugin-sdk'import { useState } from 'react'import { labeled } from './dialog-parts'+import { useBots } from './i18n'import { botRouteKey, requestForBot, resolveBotConnectionRoute } from './routing'import { ID } from './shared'import type { RosterRow } from './types'@@ -116,7 +118,9 @@ interface ModelPickerProps {value: ModelSelection}-export function ModelPicker({ bot = null, value, onChange, placeholderModel = 'gateway default' }: ModelPickerProps) {+export function ModelPicker({ bot = null, value, onChange, placeholderModel }: ModelPickerProps) {+ const b = useBots()+ const { t } = useI18n()const { data, isLoading, error } = useModelOptions(bot)// Hooks are ALWAYS declared up front, before any conditional return.@@ -140,7 +144,7 @@ export function ModelPicker({ bot = null, value, onChange, placeholderModel = 'greturn (<div className="grid grid-cols-2 gap-2.5">{labeled(- 'Provider',+ t.settings.model.provider,<InputonChange={event =>onChange({@@ -152,7 +156,7 @@ export function ModelPicker({ bot = null, value, onChange, placeholderModel = 'g/>)}{labeled(- 'Model',+ t.settings.model.model,<InputonChange={event =>onChange({@@ -172,26 +176,26 @@ export function ModelPicker({ bot = null, value, onChange, placeholderModel = 'g<div className="flex flex-col gap-2"><div className="grid grid-cols-2 gap-2.5">{labeled(- 'Provider (Custom)',+ b.editor.providerCustom,<InputonChange={event =>onChange({provider: event.target.value})}- placeholder="e.g. omnirouter, inferx, 9router"+ placeholder="omnirouter / inferx / 9router"value={value.provider}/>)}{labeled(- 'Model (Custom)',+ b.editor.modelCustom,<InputonChange={event =>onChange({model: event.target.value})}- placeholder="e.g. antigravity/gemini-3.6-flash-high"+ placeholder="antigravity/gemini-3.6-flash-high"value={value.model}/>)}@@ -202,7 +206,7 @@ export function ModelPicker({ bot = null, value, onChange, placeholderModel = 'gsize="sm"variant="ghost">- ← Back to dropdowns+ {b.editor.backToDropdowns}</Button></div>)@@ -217,7 +221,7 @@ export function ModelPicker({ bot = null, value, onChange, placeholderModel = 'greturn (<div className="grid grid-cols-[1fr_1.4fr] gap-2.5">{labeled(- 'Provider',+ t.settings.model.provider,<SelectonValueChange={v => {if (v === NONE) {@@ -243,18 +247,18 @@ export function ModelPicker({ bot = null, value, onChange, placeholderModel = 'g<SelectValue /></SelectTrigger><SelectContent>- <SelectItem value={NONE}>Inherit (launch profile)</SelectItem>+ <SelectItem value={NONE}>{b.editor.inheritLaunch}</SelectItem>{providers.map(p => (<SelectItem key={p.slug} value={p.slug}>{p.name ? `${p.name} (${p.slug})` : p.slug}</SelectItem>))}- <SelectItem value={CUSTOM}>✏️ Enter manually…</SelectItem>+ <SelectItem value={CUSTOM}>{b.editor.enterManually}</SelectItem></SelectContent></Select>)}{labeled(- 'Model',+ t.settings.model.model,activeProvider && models.length > 0 ? (<SelectonValueChange={v =>@@ -282,7 +286,9 @@ export function ModelPicker({ bot = null, value, onChange, placeholderModel = 'gmodel: event.target.value})}- placeholder={placeholderModel || 'e.g. model name'}+ placeholder={+ placeholderModel === undefined ? b.editor.gatewayDefault : placeholderModel || b.editor.modelNameExample+ }value={value.model}/>)diff --git a/apps/desktop/src/plugins/hermes-bots/profile-config-capabilities.test.tsx b/apps/desktop/src/plugins/hermes-bots/profile-config-capabilities.test.tsxindex fccbc47aebb..a6bb21ba61d 100644--- a/apps/desktop/src/plugins/hermes-bots/profile-config-capabilities.test.tsx+++ b/apps/desktop/src/plugins/hermes-bots/profile-config-capabilities.test.tsx@@ -215,7 +215,7 @@ describe('a build whose CapabilitiesView cannot route connections', () => {// The staged checklist and the hub search section both survive here.expect(screen.getByText('staged-skill')).toBeTruthy()- expect(screen.getByText('Skills Hub')).toBeTruthy()+ expect(screen.getByText(translateBots('tools.skillsHub'))).toBeTruthy()expect(sdk.seen.ToolsetConfigPanel[0]).toEqual({profile: { connectionId: 'local', profile: 'default' },toolset: 'local-tools'diff --git a/apps/desktop/src/plugins/hermes-bots/profile-config.tsx b/apps/desktop/src/plugins/hermes-bots/profile-config.tsxindex 3be45996daa..da265f89219 100644--- a/apps/desktop/src/plugins/hermes-bots/profile-config.tsx+++ b/apps/desktop/src/plugins/hermes-bots/profile-config.tsx@@ -22,7 +22,7 @@ import { useState } from 'react'import { $lastRoster, ROSTER_KEY } from './data'import { labeled, ResizableFrame } from './dialog-parts'-import { useBots } from './i18n'+import { botsText, useBots } from './i18n'import { McpSetupButton } from './mcp-setup'import { ModelPicker } from './model-picker'import { botBackendProfileScope, requestForBot, resolveBotConnectionRoute } from './routing'@@ -183,11 +183,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC}if (unsupported) {- return (- <div className="px-2 py-3 text-center text-xs text-(--ui-text-tertiary)">- Full configuration needs a newer gateway (restart it after updating Hermes).- </div>- )+ return <div className="px-2 py-3 text-center text-xs text-(--ui-text-tertiary)">{b.editor.fullConfigHint}</div>}if (!state.loaded) {@@ -273,7 +269,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC}}/>{labeled(- 'Capabilities (applies immediately — skills, tools, MCP)',+ b.editor.liveCapabilities,<ResizableFrame height={460} minHeight={300}><CapabilitiesViewembedded@@ -287,7 +283,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC</ResizableFrame>)}{labeled(- 'SOUL.md (persona + agent-messaging protocol)',+ b.editor.editSoul,<TextareaclassName="min-h-28 font-mono text-xs leading-5"onChange={event =>@@ -322,10 +318,10 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC}}/><div className="rounded-md border border-(--ui-stroke-secondary) px-3 py-2 text-xs text-(--ui-text-tertiary)">- Remote capabilities require a newer desktop. Model and SOUL changes remain staged until you save.+ {b.editor.remoteCapabilitiesHint}</div>{labeled(- 'SOUL.md (persona + agent-messaging protocol)',+ b.editor.editSoul,<TextareaclassName="min-h-28 font-mono text-xs leading-5"onChange={event =>@@ -359,7 +355,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC}}/>{labeled(- `Skills (${enabledSkills}/${state.skills.length} enabled)`,+ b.editor.skillsEnabled(enabledSkills, state.skills.length),<div className="grid gap-1.5 rounded-md border border-(--ui-stroke-secondary) p-2"><InputclassName="h-7 text-xs"@@ -397,7 +393,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC</div>)}{labeled(- `Toolsets (${enabledToolsets}/${state.toolsets.length} enabled — unchecking all restores the default)`,+ b.editor.toolsetsEnabled(enabledToolsets, state.toolsets.length),<div className="rounded-md border border-(--ui-stroke-secondary) p-2"><divclassName="overflow-y-auto overscroll-contain"@@ -430,7 +426,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC</div>)}{labeled(- 'MCP servers',+ b.editor.mcpServers,<div className="overflow-hidden rounded-md border border-(--ui-stroke-secondary)">{ConnectorsTab && typeof host.getGateway === 'function' ? (<div@@ -469,7 +465,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC<span>{m.name}</span>{m.fromCatalog && !needsSetup ? (<span className="ml-1.5 text-[0.65rem] text-(--ui-text-quaternary)">- {m.installed ? 'catalog · installed' : 'catalog'}+ {m.installed ? b.editor.catalogInstalled : b.editor.catalog}</span>) : null}{needsSetup ? (@@ -490,7 +486,7 @@ export function AdvancedProfileConfig({ bot, state, setState }: AdvancedProfileC</div>)}{labeled(- 'SOUL.md (persona + agent-messaging protocol)',+ b.editor.editSoul,<TextareaclassName="min-h-28 font-mono text-xs leading-5"onChange={event =>@@ -618,7 +614,7 @@ export async function applyAdvancedConfig(bot: RosterRow, state: AdvancedConfigSdelete merged.modelvoid surfaceModelSwitchConfirm({confirmMessage: result.confirm_message,- failureMessage: 'Model switch failed',+ failureMessage: botsText().editor.modelSwitchFailed,finish: () =>queryClient.invalidateQueries({queryKey: ROSTER_KEYdiff --git a/apps/desktop/src/plugins/hermes-bots/skills-hub-picker.test.tsx b/apps/desktop/src/plugins/hermes-bots/skills-hub-picker.test.tsxindex 088ae42cd26..acefa3821a1 100644--- a/apps/desktop/src/plugins/hermes-bots/skills-hub-picker.test.tsx+++ b/apps/desktop/src/plugins/hermes-bots/skills-hub-picker.test.tsx@@ -13,6 +13,8 @@ import type * as HermesSdk from '@hermes/plugin-sdk'import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import { translateBots } from './i18n-test-helper'+const HUB_ORIGIN = 'https://hermes-agent.nousresearch.com'const mocks = vi.hoisted(() => ({@@ -27,6 +29,7 @@ vi.mock('@hermes/plugin-sdk', async importOriginal => {return {...original,+ usePluginI18n: () => translateBots,host: {...original.host,notify: mocks.notify,@@ -49,7 +52,7 @@ interface PickMessage {function openHubBrowser() {const { container } = render(<HubSkillsSection />)- fireEvent.click(screen.getByRole('button', { name: /browse the full hub/ }))+ fireEvent.click(screen.getByRole('button', { name: /browse the full hub/i }))const frame = container.querySelector('iframe')@@ -115,7 +118,7 @@ describe('hub pick messages', () => {/>)- fireEvent.click(screen.getByRole('button', { name: /browse the full hub/ }))+ fireEvent.click(screen.getByRole('button', { name: /browse the full hub/i }))const frame = container.querySelector('iframe') as HTMLIFrameElementpostPick(@@ -195,7 +198,7 @@ describe('hub pick messages', () => {it('stops listening once the hub browser is closed', () => {const frame = openHubBrowser()- fireEvent.click(screen.getByRole('button', { name: /hide the hub browser/ }))+ fireEvent.click(screen.getByRole('button', { name: /hide the hub browser/i }))postPick({ identifier: 'nous/web-research', name: 'Web Research', type: 'hermes-skill-pick' },{diff --git a/apps/desktop/src/plugins/hermes-bots/skills-hub.tsx b/apps/desktop/src/plugins/hermes-bots/skills-hub.tsxindex 8039e3ebd6a..cecaa0d87af 100644--- a/apps/desktop/src/plugins/hermes-bots/skills-hub.tsx+++ b/apps/desktop/src/plugins/hermes-bots/skills-hub.tsx@@ -6,7 +6,7 @@* it reaches back into neither.*/-import { Button, host, Input } from '@hermes/plugin-sdk'+import { Button, host, Input, useI18n } from '@hermes/plugin-sdk'import { useEffect, useRef, useState } from 'react'import { useBots } from './i18n'@@ -35,6 +35,8 @@ interface HubSkillsSectionProps {export function HubSkillsSection({ bot, onInstalled }: HubSkillsSectionProps) {const b = useBots()+ const { t } = useI18n()+ const h = t.skills.hubconst [query, setQuery] = useState('')const [results, setResults] = useState<HubSkillResult[] | null>(null)const [searching, setSearching] = useState(false)@@ -136,14 +138,14 @@ export function HubSkillsSection({ bot, onInstalled }: HubSkillsSectionProps) {}))host.notify({kind: 'success',- message: `Skill "${label}" installed`+ message: b.tools.installed(label)})if (typeof onInstalled === 'function') {onInstalled(label)}} catch (err) {- host.notifyError(err, `Installing "${label}" failed`)+ host.notifyError(err, b.tools.installFailed(label))} finally {setInstalling(null)}@@ -154,14 +156,14 @@ export function HubSkillsSection({ bot, onInstalled }: HubSkillsSectionProps) {return (<div className="grid gap-1.5 border-t border-(--ui-stroke-secondary) pt-2"><div className="flex items-baseline justify-between gap-2">- <div className="text-[0.7rem] font-medium text-(--ui-text-secondary)">Skills Hub</div>+ <div className="text-[0.7rem] font-medium text-(--ui-text-secondary)">{b.tools.skillsHub}</div><ButtonclassName="text-[0.65rem] text-(--ui-text-quaternary) hover:text-(--ui-text-secondary)"onClick={() => setBrowseHub(v => !v)}size="inline"variant="text">- {browseHub ? 'hide the hub browser' : 'browse the full hub ▾'}+ {browseHub ? h.pickerHide : h.pickerBrowse}</Button></div>{browseHub ? (@@ -196,9 +198,7 @@ export function HubSkillsSection({ bot, onInstalled }: HubSkillsSectionProps) {/></div><div className="px-1 text-[0.65rem] leading-4 text-(--ui-text-quaternary)">- {installing- ? `Installing "${installing}"…`- : 'Hit "+ Add to this Agent" on any skill — it installs and appears in the list above. Drag the corner to resize.'}+ {installing ? h.installStarted(installing) : `${h.pickerHint} ${b.tools.resizeHint}`}</div></div>) : null}@@ -221,16 +221,12 @@ export function HubSkillsSection({ bot, onInstalled }: HubSkillsSectionProps) {value={query}/><Button disabled={searching || !query.trim()} onClick={() => void search()} size="sm" variant="secondary">- {searching ? 'Searching…' : 'Search'}+ {searching ? h.searching : h.search}</Button></div>- {searching ? (- <div className="px-1 text-[0.65rem] text-(--ui-text-quaternary)">- Searching community + well-known sources — can take ~10s…- </div>- ) : null}+ {searching ? <div className="px-1 text-[0.65rem] text-(--ui-text-quaternary)">{b.tools.searchHint}</div> : null}{results === null ? null : results.length === 0 ? (- <div className="px-1 py-1.5 text-[0.7rem] text-(--ui-text-quaternary)">No hub skills matched.</div>+ <div className="px-1 py-1.5 text-[0.7rem] text-(--ui-text-quaternary)">{h.noResults}</div>) : (<divclassName="overflow-y-auto overscroll-contain"@@ -248,10 +244,10 @@ export function HubSkillsSection({ bot, onInstalled }: HubSkillsSectionProps) {) : null}</div>{installed[r.name] ? (- <span className="shrink-0 text-[0.65rem] text-(--ui-text-tertiary)">✓ added</span>+ <span className="shrink-0 text-[0.65rem] text-(--ui-text-tertiary)">✓ {h.installed}</span>) : (<Button- aria-label={`Install "${r.name}" and add it to the list above`}+ aria-label={b.tools.installHint(r.name)}className="shrink-0 px-2 font-semibold"disabled={installing !== null}onClick={() => void install(r.name)}