Skip to content

The agent that grows with you

fmt(js): `npm run fix` on merge (#87839)

hermes-seaeye[bot]b007b80cb7e9
diff --git a/apps/desktop/electron/connection-registry.test.ts b/apps/desktop/electron/connection-registry.test.ts
index 05675323b97..35d9d386c72 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 13fc063c6fb..286493d0066 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 f8344317bf0..ea655d961b5 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 fd0bded1ed6..d65d8dd3279 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 2064b57419a..b9664513cb7 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 b7486a5c59f..9f3fd353408 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<DesktopSshHostsResult>
sshResolveHost: (host: string) => Promise<DesktopSshResolveResult>
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 597c41b0b74..90fee9d5069 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 bf45ae19d72..8ce52c0734e 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 a7a87b3ed35..83c68d9a7b3 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 05ad5208c9a..bf6bf770d0f 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 b930b5b4cf0..958fd768f51 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 dc9eef5fa7e..243a6eec0f0 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<void> {
}
const raw = config.mcp_servers
+
const servers =
raw && typeof raw === 'object' && !Array.isArray(raw) ? (raw as Record<string, Record<string, unknown>>) : {}
diff --git a/apps/desktop/src/store/profile-agent-activation.test.ts b/apps/desktop/src/store/profile-agent-activation.test.ts
index 5d79ccb30ec..2c2f7d6c5ad 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> = {}): HermesConnection =>
({ baseUrl: '', mode: 'local', profile: 'default', ...over }) as HermesConnection
const getConnection = vi.fn<(profile?: string | null) => Promise<HermesConnection>>()
-const getConnectionFor = vi.fn<(payload: { connectionId?: null | string; profile?: null | string }) => Promise<HermesConnection>>()
+const getConnectionFor =
+ vi.fn<(payload: { connectionId?: null | string; profile?: null | string }) => Promise<HermesConnection>>()
function deferred(): { promise: Promise<void>; resolve: () => void } {
let resolve!: () => void
diff --git a/apps/desktop/src/store/session-states.ts b/apps/desktop/src/store/session-states.ts
index 2484195d56e..028d85c910f 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<Record<string, ClientSessionState>>({})
const sessionScopeByRuntimeId = new Map<string, string>()
-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))
}