diff --git a/apps/desktop/electron/connection-registry.test.ts b/apps/desktop/electron/connection-registry.test.ts index 05675323b9..35d9d386c7 100644 --- a/apps/desktop/electron/connection-registry.test.ts +++ b/apps/desktop/electron/connection-registry.test.ts @@ -131,13 +131,13 @@ test('backendScopeKey: non-local connections get an unambiguous composite', () = // --- resolveRegistryLocalRoute (registry 'local' entry vs the v1 route) --- -test("registry local route: delegates to the legacy path when v1 is local (single-source users byte-identical)", () => { +test('registry local route: delegates to the legacy path when v1 is local (single-source users byte-identical)', () => { assert.deepEqual(resolveRegistryLocalRoute('research', {}), { delegate: true, poolKey: 'research' }) assert.deepEqual(resolveRegistryLocalRoute('', {}), { delegate: true, poolKey: 'default' }) assert.deepEqual(resolveRegistryLocalRoute(null, { globalRemote: false }), { delegate: true, poolKey: 'default' }) }) -test("registry local route: v1 REMOTE global mode forces a genuinely-local backend (migration scenario)", () => { +test('registry local route: v1 REMOTE global mode forces a genuinely-local backend (migration scenario)', () => { // The migration keeps the mandatory 'local' entry AND makes the v1 remote // the registry primary. If 'local' delegated to the v1 route here, the // roster's "This device" rows would enumerate + dial the REMOTE primary — @@ -559,7 +559,14 @@ test('upsertConnection replaces by id and appends new ids', () => { // --- connectionDialFieldsChanged (edit → recycle decision) --- test('connectionDialFieldsChanged: label-only edits do not recycle', () => { - const before = { id: 'homelab', kind: 'remote', label: 'Homelab', url: 'http://10.0.0.5:9119', authMode: 'token', token: { encoding: 'safeStorage', value: 'abc' } } as const + const before = { + id: 'homelab', + kind: 'remote', + label: 'Homelab', + url: 'http://10.0.0.5:9119', + authMode: 'token', + token: { encoding: 'safeStorage', value: 'abc' } + } as const assert.equal(connectionDialFieldsChanged(before, { ...before, label: 'Home lab (renamed)' }), false) // Identity edit is also a no-op. @@ -567,11 +574,21 @@ test('connectionDialFieldsChanged: label-only edits do not recycle', () => { }) test('connectionDialFieldsChanged: url / auth / token changes recycle', () => { - const before = { id: 'homelab', kind: 'remote', label: 'Homelab', url: 'http://10.0.0.5:9119', authMode: 'token', token: { encoding: 'safeStorage', value: 'abc' } } as const + const before = { + id: 'homelab', + kind: 'remote', + label: 'Homelab', + url: 'http://10.0.0.5:9119', + authMode: 'token', + token: { encoding: 'safeStorage', value: 'abc' } + } as const assert.equal(connectionDialFieldsChanged(before, { ...before, url: 'http://10.0.0.9:9119' }), true) assert.equal(connectionDialFieldsChanged(before, { ...before, authMode: 'oauth', token: undefined }), true) - assert.equal(connectionDialFieldsChanged(before, { ...before, token: { encoding: 'safeStorage', value: 'NEW' } }), true) + assert.equal( + connectionDialFieldsChanged(before, { ...before, token: { encoding: 'safeStorage', value: 'NEW' } }), + true + ) }) test('connectionDialFieldsChanged: ssh routing fields recycle, kind change recycles', () => { @@ -581,5 +598,8 @@ test('connectionDialFieldsChanged: ssh routing fields recycle, kind change recyc assert.equal(connectionDialFieldsChanged(before, { ...before, host: 'other.lan' }), true) assert.equal(connectionDialFieldsChanged(before, { ...before, port: 2222 }), true) assert.equal(connectionDialFieldsChanged(before, { ...before, remoteProfile: 'work' }), true) - assert.equal(connectionDialFieldsChanged(before, { id: 'box', kind: 'remote', label: 'Box', url: 'http://x:1' }), true) + assert.equal( + connectionDialFieldsChanged(before, { id: 'box', kind: 'remote', label: 'Box', url: 'http://x:1' }), + true + ) }) diff --git a/apps/desktop/src/app/chat/composer/controls.tsx b/apps/desktop/src/app/chat/composer/controls.tsx index 13fc063c6f..286493d006 100644 --- a/apps/desktop/src/app/chat/composer/controls.tsx +++ b/apps/desktop/src/app/chat/composer/controls.tsx @@ -5,17 +5,7 @@ import { Codicon } from '@/components/ui/codicon' import { Tip, TipKeybindLabel } from '@/components/ui/tooltip' import { useI18n } from '@/i18n' import { triggerHaptic } from '@/lib/haptics' -import { - AudioLines, - Ear, - EarOff, - iconSize, - Layers3, - Loader2, - Square, - Volume2, - VolumeX -} from '@/lib/icons' +import { AudioLines, Ear, EarOff, iconSize, Layers3, Loader2, Square, Volume2, VolumeX } from '@/lib/icons' import { cn } from '@/lib/utils' import { $wakeWord, toggleWakeWord } from '@/store/wake-word' diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event.ts index f8344317bf..ea655d961b 100644 --- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event.ts +++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event.ts @@ -343,8 +343,7 @@ export function useGatewayEventHandler(deps: GatewayEventDeps) { // backendScopeKey — untagged (local/primary) events keep the legacy // bare-profile behavior byte-identical. const fromActiveSource = (): boolean => - (!event.profile || - normalizeProfileKey(event.profile) === normalizeProfileKey($activeGatewayProfile.get())) && + (!event.profile || normalizeProfileKey(event.profile) === normalizeProfileKey($activeGatewayProfile.get())) && backendScopeKey(event.connectionId ?? null, event.profile ?? null) === backendScopeKey(activeGatewayConnectionId(), event.profile ?? null) @@ -508,12 +507,7 @@ export function useGatewayEventHandler(deps: GatewayEventDeps) { // gateway may reconcile the foreground cache. Requiring the renderer's // source tag prevents an event queued before a profile swap from being // attributed to the newly active profile. - if ( - isActiveEvent && - typeof payload?.approval_mode === 'string' && - event.profile && - fromActiveSource() - ) { + if (isActiveEvent && typeof payload?.approval_mode === 'string' && event.profile && fromActiveSource()) { reconcileApprovalModeForProfile(event.profile, payload.approval_mode) } diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.ts index fd0bded1ed..d65d8dd327 100644 --- a/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.ts +++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.ts @@ -100,7 +100,6 @@ describe('submit in-flight TTL', () => { }) }) - describe('isTargetSessionBusy', () => { it('reads the target session slice, not the leftover foreground flag', () => { expect(isTargetSessionBusy({ a: { busy: true }, b: { busy: false } }, 'b', true)).toBe(false) diff --git a/apps/desktop/src/app/skills/mcp-tab.tsx b/apps/desktop/src/app/skills/mcp-tab.tsx index 2064b57419..b9664513cb 100644 --- a/apps/desktop/src/app/skills/mcp-tab.tsx +++ b/apps/desktop/src/app/skills/mcp-tab.tsx @@ -1453,13 +1453,7 @@ function ServerIconActions({ // README shape — mcp.json snippet, npx/docker command line, `claude mcp add`, // a bare URL, or a Cursor deeplink — see the inferred name + config, then // merge it into the editor draft (unsaved, like the "+" starter entry). -function McpImportButton({ - disabled, - onImport -}: { - disabled: boolean - onImport: (entries: McpImportEntry[]) => void -}) { +function McpImportButton({ disabled, onImport }: { disabled: boolean; onImport: (entries: McpImportEntry[]) => void }) { const { t } = useI18n() const m = t.settings.mcp const [open, setOpen] = useState(false) diff --git a/apps/desktop/src/global.d.ts b/apps/desktop/src/global.d.ts index b7486a5c59..9f3fd35340 100644 --- a/apps/desktop/src/global.d.ts +++ b/apps/desktop/src/global.d.ts @@ -147,9 +147,7 @@ declare global { // materially edited so the renderer can dispose (and re-dial) the // secondary gateways scoped to it. Optional: older Electron mains // don't emit it. - onChanged?: ( - callback: (payload: { connectionId: string; reason: 'removed' | 'updated' }) => void - ) => () => void + onChanged?: (callback: (payload: { connectionId: string; reason: 'removed' | 'updated' }) => void) => () => void } sshConfigHosts: () => Promise sshResolveHost: (host: string) => Promise diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts index 597c41b0b7..90fee9d506 100644 --- a/apps/desktop/src/i18n/types.ts +++ b/apps/desktop/src/i18n/types.ts @@ -793,7 +793,7 @@ export interface Translations { deepLinkErrorConfig: string deepLinkErrorShape: string deepLinkErrorUrl: string - deepLinkErrorTooLarge: string, + deepLinkErrorTooLarge: string importButton: string importPlaceholder: string importNoMatch: string diff --git a/apps/desktop/src/lib/mcp-import.test.ts b/apps/desktop/src/lib/mcp-import.test.ts index bf45ae19d7..8ce52c0734 100644 --- a/apps/desktop/src/lib/mcp-import.test.ts +++ b/apps/desktop/src/lib/mcp-import.test.ts @@ -100,18 +100,18 @@ describe('parseMcpImport', () => { describe('claude mcp add lines', () => { it('parses a stdio add with env and a -- separator', () => { - expect(parseMcpImport('claude mcp add airtable -e AIRTABLE_API_KEY=YOUR_KEY -- npx -y airtable-mcp-server')).toEqual( - [ - { - config: { - args: ['-y', 'airtable-mcp-server'], - command: 'npx', - env: { AIRTABLE_API_KEY: 'YOUR_KEY' } - }, - name: 'airtable' - } - ] - ) + expect( + parseMcpImport('claude mcp add airtable -e AIRTABLE_API_KEY=YOUR_KEY -- npx -y airtable-mcp-server') + ).toEqual([ + { + config: { + args: ['-y', 'airtable-mcp-server'], + command: 'npx', + env: { AIRTABLE_API_KEY: 'YOUR_KEY' } + }, + name: 'airtable' + } + ]) }) it('parses a stdio add without a -- separator', () => { @@ -131,7 +131,9 @@ describe('parseMcpImport', () => { it('parses an sse add with a header', () => { expect( - parseMcpImport('claude mcp add --transport sse api -H "Authorization: Bearer TOKEN_HERE" https://api.example.com/sse') + parseMcpImport( + 'claude mcp add --transport sse api -H "Authorization: Bearer TOKEN_HERE" https://api.example.com/sse' + ) ).toEqual([ { config: { diff --git a/apps/desktop/src/sdk/index.test.ts b/apps/desktop/src/sdk/index.test.ts index a7a87b3ed3..83c68d9a7b 100644 --- a/apps/desktop/src/sdk/index.test.ts +++ b/apps/desktop/src/sdk/index.test.ts @@ -2,11 +2,7 @@ import { afterEach, describe, expect, it } from 'vitest' import { createClientSessionState } from '@/lib/chat-runtime' import { host } from '@/sdk' -import { - setActiveSessionId, - setAwaitingResponse, - setBusy -} from '@/store/session' +import { setActiveSessionId, setAwaitingResponse, setBusy } from '@/store/session' import { clearAllSessionStates, publishSessionState } from '@/store/session-states' describe('host.state turn flags', () => { diff --git a/apps/desktop/src/sdk/index.ts b/apps/desktop/src/sdk/index.ts index 05ad5208c9..bf6bf770d0 100644 --- a/apps/desktop/src/sdk/index.ts +++ b/apps/desktop/src/sdk/index.ts @@ -38,13 +38,7 @@ import { setActiveProfile, setShowAllProfiles } from '@/store/profile' -import { - $activeSessionId, - $currentCwd, - $currentModel, - $gatewayState, - $selectedStoredSessionId -} from '@/store/session' +import { $activeSessionId, $currentCwd, $currentModel, $gatewayState, $selectedStoredSessionId } from '@/store/session' import { $focusedRuntimeId, $focusedSessionState, diff --git a/apps/desktop/src/store/gateway-connection-scope.test.ts b/apps/desktop/src/store/gateway-connection-scope.test.ts index b930b5b4cf..958fd768f5 100644 --- a/apps/desktop/src/store/gateway-connection-scope.test.ts +++ b/apps/desktop/src/store/gateway-connection-scope.test.ts @@ -38,8 +38,13 @@ vi.mock('@/store/session', () => ({ })) vi.mock('@/store/notify-baseline', () => ({ markNativeNotifyBaseline: vi.fn() })) -const { closeSecondaryGateways, configureGatewayRegistry, openGatewayForAgent, pruneSecondaryGateways, setPrimaryGateway } = - await import('./gateway') +const { + closeSecondaryGateways, + configureGatewayRegistry, + openGatewayForAgent, + pruneSecondaryGateways, + setPrimaryGateway +} = await import('./gateway') function installDesktop(): void { ;(window as unknown as { hermesDesktop: unknown }).hermesDesktop = { diff --git a/apps/desktop/src/store/mcp-health.ts b/apps/desktop/src/store/mcp-health.ts index dc9eef5fa7..243a6eec0f 100644 --- a/apps/desktop/src/store/mcp-health.ts +++ b/apps/desktop/src/store/mcp-health.ts @@ -107,6 +107,7 @@ async function sweep(): Promise { } const raw = config.mcp_servers + const servers = raw && typeof raw === 'object' && !Array.isArray(raw) ? (raw as Record>) : {} diff --git a/apps/desktop/src/store/profile-agent-activation.test.ts b/apps/desktop/src/store/profile-agent-activation.test.ts index 5d79ccb30e..2c2f7d6c5a 100644 --- a/apps/desktop/src/store/profile-agent-activation.test.ts +++ b/apps/desktop/src/store/profile-agent-activation.test.ts @@ -43,7 +43,8 @@ const localConn = (over: Partial = {}): HermesConnection => ({ baseUrl: '', mode: 'local', profile: 'default', ...over }) as HermesConnection const getConnection = vi.fn<(profile?: string | null) => Promise>() -const getConnectionFor = vi.fn<(payload: { connectionId?: null | string; profile?: null | string }) => Promise>() +const getConnectionFor = + vi.fn<(payload: { connectionId?: null | string; profile?: null | string }) => Promise>() function deferred(): { promise: Promise; resolve: () => void } { let resolve!: () => void diff --git a/apps/desktop/src/store/session-states.ts b/apps/desktop/src/store/session-states.ts index 2484195d56..028d85c910 100644 --- a/apps/desktop/src/store/session-states.ts +++ b/apps/desktop/src/store/session-states.ts @@ -68,11 +68,7 @@ export const $sessionStates = atom>({}) const sessionScopeByRuntimeId = new Map() -export function recordSessionEventScope(event: { - connectionId?: string - profile?: string - session_id?: string -}): void { +export function recordSessionEventScope(event: { connectionId?: string; profile?: string; session_id?: string }): void { if (event.session_id && event.connectionId) { sessionScopeByRuntimeId.set(event.session_id, backendScopeKey(event.connectionId, event.profile)) }