Skip to content

The agent that grows with you

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

hermes-seaeye[bot]6ffe3b2b59ad
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 4af3c1294a3..749ccd0a52a 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -9403,7 +9403,15 @@ async function sanitizeDesktopConnectionConfig(config = readDesktopConnectionCon
// `org` (optional) is the Hermes Cloud org slug/id the instance was discovered
// under — persisted so Settings can reopen into the same org; omitted from the
// block when empty so plain remote connections stay unchanged.
-function buildRemoteBlock(remoteUrl, authMode, token, org?: string, headers?: object, name?: string, remoteProfile?: string) {
+function buildRemoteBlock(
+ remoteUrl,
+ authMode,
+ token,
+ org?: string,
+ headers?: object,
+ name?: string,
+ remoteProfile?: string
+) {
if (authMode !== 'oauth' && !decryptDesktopSecret(token)) {
throw new Error('Remote gateway session token is required.')
}
@@ -13795,10 +13803,12 @@ const instanceWindows = new Set<any>()
// pure cascade math lives in session-windows.ts (instanceWindowBounds).
function nextInstanceBounds(source: BrowserWindow | null = BrowserWindow.getFocusedWindow() || mainWindow) {
const displays = screen.getAllDisplays()
+
const fallback = computeWindowOptions(
readWindowState() ?? firstLaunchSize(screen.getPrimaryDisplay().workArea),
displays
)
+
const base = source && !source.isDestroyed() ? source.getBounds() : null
return instanceWindowBounds(base, fallback, displays)
@@ -16875,12 +16885,7 @@ async function interceptSessionRequestForRemote(request, registryConnectionId =
}
if (
- !hasPinnedRegistrySessionSource(
- registryConnectionId,
- request?.profile,
- registrySources,
- !globalRemoteActive()
- )
+ !hasPinnedRegistrySessionSource(registryConnectionId, request?.profile, registrySources, !globalRemoteActive())
) {
// Do not manufacture a partial all-gateways response while the selected
// registry backend is still dialing or has just gone idle. The caller
@@ -16916,12 +16921,7 @@ async function interceptSessionRequestForRemote(request, registryConnectionId =
}
if (
- !hasPinnedRegistrySessionSource(
- registryConnectionId,
- request?.profile,
- registrySources,
- !globalRemoteActive()
- )
+ !hasPinnedRegistrySessionSource(registryConnectionId, request?.profile, registrySources, !globalRemoteActive())
) {
return undefined
}
diff --git a/apps/desktop/electron/profile-session-routing.test.ts b/apps/desktop/electron/profile-session-routing.test.ts
index 0a68f747c80..b5bad5da537 100644
--- a/apps/desktop/electron/profile-session-routing.test.ts
+++ b/apps/desktop/electron/profile-session-routing.test.ts
@@ -378,10 +378,7 @@ test('registry sources: forced-local backends are read per profile', async () =>
}
)
- assert.deepEqual(calls, [
- 'default-desc /api/sessions?limit=10',
- 'work-desc /api/sessions?limit=10'
- ])
+ assert.deepEqual(calls, ['default-desc /api/sessions?limit=10', 'work-desc /api/sessions?limit=10'])
assert.deepEqual(
rows.map(row => [(row as any).id, (row as any).profile, (row as any).connection_id]),
[
@@ -451,7 +448,10 @@ test('registry sources: large aggregate reads stay within the backend page cap',
)
assert.deepEqual(
- calls.map(path => [Number(new URL(path, 'http://desktop.test').searchParams.get('limit')), Number(new URL(path, 'http://desktop.test').searchParams.get('offset'))]),
+ calls.map(path => [
+ Number(new URL(path, 'http://desktop.test').searchParams.get('limit')),
+ Number(new URL(path, 'http://desktop.test').searchParams.get('offset'))
+ ]),
[
[100, 0],
[100, 100],
diff --git a/apps/desktop/electron/profile-session-routing.ts b/apps/desktop/electron/profile-session-routing.ts
index 803c97bd563..b58412e7272 100644
--- a/apps/desktop/electron/profile-session-routing.ts
+++ b/apps/desktop/electron/profile-session-routing.ts
@@ -367,9 +367,7 @@ async function fetchSessionRowsInPages(
const page = await getPage(`${basePath}?${pageParams}`)
const pageRows = rowsOf(page)
- const total = nonNegativeNumber(
- page && typeof page === 'object' ? (page as { total?: unknown }).total : null
- )
+ const total = nonNegativeNumber(page && typeof page === 'object' ? (page as { total?: unknown }).total : null)
const windowedCount =
total !== null ? Math.min(pageLimit, Math.max(0, total - pageOffset)) : Math.min(pageLimit, pageRows.length)
diff --git a/apps/desktop/electron/remote-lifecycle.test.ts b/apps/desktop/electron/remote-lifecycle.test.ts
index d2e9acbda42..78b3132aed6 100644
--- a/apps/desktop/electron/remote-lifecycle.test.ts
+++ b/apps/desktop/electron/remote-lifecycle.test.ts
@@ -851,10 +851,12 @@ test.skipIf(process.platform !== 'linux')(
const raw = await readFile(`/proc/${child.pid}/stat`, 'utf8')
- const creationTime = `linux:${raw
- .slice(raw.lastIndexOf(')') + 2)
- .trim()
- .split(/\s+/)[19]}`
+ const creationTime = `linux:${
+ raw
+ .slice(raw.lastIndexOf(')') + 2)
+ .trim()
+ .split(/\s+/)[19]
+ }`
const lock = ownedLock({
pid: child.pid,
diff --git a/apps/desktop/electron/ssh-connection.test.ts b/apps/desktop/electron/ssh-connection.test.ts
index 9c14060f6eb..7a88436d751 100644
--- a/apps/desktop/electron/ssh-connection.test.ts
+++ b/apps/desktop/electron/ssh-connection.test.ts
@@ -559,10 +559,7 @@ test('mux forward keeps the ControlPersist master alive until the final forward
try {
const spawnFn = scriptedSpawn({ code: 0 })
- const conn = new SshConnection(
- { host: 'box', user: 'me' },
- { spawnFn, controlDir: '/tmp/d' }
- )
+ const conn = new SshConnection({ host: 'box', user: 'me' }, { spawnFn, controlDir: '/tmp/d' })
await conn.forward(5000, 6000)
await conn.forward(5001, 6001)
diff --git a/apps/desktop/src/app/chat/right-rail/preview-console-state.ts b/apps/desktop/src/app/chat/right-rail/preview-console-state.ts
index 4d299032c70..e2f1a8b0582 100644
--- a/apps/desktop/src/app/chat/right-rail/preview-console-state.ts
+++ b/apps/desktop/src/app/chat/right-rail/preview-console-state.ts
@@ -100,6 +100,7 @@ export function createPreviewConsoleState() {
? {}
: { source: truncateConsoleText(entry.source, PREVIEW_CONSOLE_MAX_SOURCE_CHARS) })
}
+
const logs = fitConsoleHistory([...$logs.get(), nextEntry])
$logs.set(logs)
diff --git a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
index cdc9d4f0edc..3d91f4cf084 100644
--- a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
+++ b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
@@ -56,11 +56,7 @@ import {
setPrimaryGatewayConnection,
touchSecondaryGateways
} from '@/store/gateway'
-import {
- type GatewayReconnectOptions,
- reconnectGateway,
- registerGatewayReconnect
-} from '@/store/gateway-reconnect'
+import { type GatewayReconnectOptions, reconnectGateway, registerGatewayReconnect } from '@/store/gateway-reconnect'
import {
$gatewaySwitching,
beginGatewaySwitch,
@@ -1243,6 +1239,7 @@ export function useGatewayBoot({
livenessProbeFailures = 0
}
+
ownCloseReason = 'manual'
gateway.close()
clearReconnectTimer()
diff --git a/apps/desktop/src/components/language-switcher.test.tsx b/apps/desktop/src/components/language-switcher.test.tsx
index 8de516ccbd5..35d31aece9d 100644
--- a/apps/desktop/src/components/language-switcher.test.tsx
+++ b/apps/desktop/src/components/language-switcher.test.tsx
@@ -47,6 +47,7 @@ describe('LanguageSwitcher', () => {
{ endonym: 'Polski', translations: { language: { switchTo: 'Zmień język' } } },
'plugin:hermes-lang-pl'
)
+
const saveConfig = vi.fn().mockResolvedValue({ ok: true })
const latestConfig: HermesConfigRecord = { display: { language: 'en' } }
diff --git a/apps/desktop/src/lib/preview-annotate/group.ts b/apps/desktop/src/lib/preview-annotate/group.ts
index 1bedc5703e5..85b767d8a3c 100644
--- a/apps/desktop/src/lib/preview-annotate/group.ts
+++ b/apps/desktop/src/lib/preview-annotate/group.ts
@@ -161,8 +161,9 @@ function refine(groups: AnnotateGroup[], total: number): AnnotateGroup[] {
*/
function flattenNested(groups: AnnotateGroup[]): AnnotateGroup[] {
const firstNumber = (group: AnnotateGroup) => group.items[0]?.number ?? 0
- const selectorsOf = (group: AnnotateGroup) =>
- group.items.map(item => item.identity?.selector || '').filter(Boolean)
+
+ const selectorsOf = (group: AnnotateGroup) => group.items.map(item => item.identity?.selector || '').filter(Boolean)
+
const owns = (parent: AnnotateGroup, child: AnnotateGroup): boolean => {
const parents = selectorsOf(parent)
const children = selectorsOf(child)
@@ -175,6 +176,7 @@ function flattenNested(groups: AnnotateGroup[]): AnnotateGroup[] {
parents.some(parentSel => childSel === parentSel || childSel.startsWith(`${parentSel}>`))
)
}
+
const sorted = [...groups].sort((left, right) => {
const leftMin = Math.min(...selectorsOf(left).map(sel => sel.length))
const rightMin = Math.min(...selectorsOf(right).map(sel => sel.length))
@@ -185,6 +187,7 @@ function flattenNested(groups: AnnotateGroup[]): AnnotateGroup[] {
return firstNumber(left) - firstNumber(right)
})
+
const kept: AnnotateGroup[] = []
for (const group of sorted) {
@@ -196,6 +199,7 @@ function flattenNested(groups: AnnotateGroup[]): AnnotateGroup[] {
const key = sharedSelectorPrefix(selectorsOf(parent))
parent.key = key
parent.label = labelFor(key)
+
continue
}
diff --git a/apps/desktop/src/store/gateway-foreground-retention.test.ts b/apps/desktop/src/store/gateway-foreground-retention.test.ts
index 36eb7d82202..ec5c740b263 100644
--- a/apps/desktop/src/store/gateway-foreground-retention.test.ts
+++ b/apps/desktop/src/store/gateway-foreground-retention.test.ts
@@ -46,9 +46,9 @@ const {
SECONDARY_MIN_LIFETIME_MS
} = await import('./gateway')
-const { $sessionTiles, foregroundSessionScopes, liveSessionScopes, recordSessionEventScope } = await import(
- './session-states'
-)
+const { $sessionTiles, foregroundSessionScopes, liveSessionScopes, recordSessionEventScope } =
+ await import('./session-states')
+
const { stampSecondaryProfileOwner } = await import('./session-event-provenance')
const { $selectedStoredSessionId, $sessions, setActiveSessionId } = await import('@/store/session')
diff --git a/apps/desktop/src/store/gateway.ts b/apps/desktop/src/store/gateway.ts
index 5574343ae21..5305817a80c 100644
--- a/apps/desktop/src/store/gateway.ts
+++ b/apps/desktop/src/store/gateway.ts
@@ -302,7 +302,7 @@ function gatewayState(): GatewayRegistryState {
// Existing dev-HMR containers predate whole-turn leases.
store[STATE_KEY].reauthFailures ??= new Map()
- store[STATE_KEY].dialFailures ??= new Map()
+ store[STATE_KEY].dialFailures ??= new Map()
store[STATE_KEY].turnLeases ??= new Map()
store[STATE_KEY].turnLeaseReleaseTimers ??= new Map()
diff --git a/apps/desktop/src/store/session-states.ts b/apps/desktop/src/store/session-states.ts
index b96f1deca25..8e5297e1fc9 100644
--- a/apps/desktop/src/store/session-states.ts
+++ b/apps/desktop/src/store/session-states.ts
@@ -302,9 +302,11 @@ export function foregroundSessionScopes(): Set<string> {
if (typeof owner === 'string') {
const key = normalizeProfileKey(owner)
+
if (key) {
scopes.add(key)
}
+
return
}
@@ -320,6 +322,7 @@ export function foregroundSessionScopes(): Set<string> {
if (scope) {
scopes.add(scope)
+
return
}
diff --git a/ui-tui/src/app/userMessages.ts b/ui-tui/src/app/userMessages.ts
index fac90e49ef9..70d4ce24f56 100644
--- a/ui-tui/src/app/userMessages.ts
+++ b/ui-tui/src/app/userMessages.ts
@@ -51,9 +51,7 @@ export const backendGaveUp = (code: null | number, lastLine?: string): string =>
const detail = detailLine(lastLine)
return [
- code === null
- ? t('userMessages.backend.gaveUpTitle')
- : t('userMessages.backend.gaveUpTitleWithCode', String(code)),
+ code === null ? t('userMessages.backend.gaveUpTitle') : t('userMessages.backend.gaveUpTitleWithCode', String(code)),
detail,
t('userMessages.backend.gaveUpReconnect'),
t('userMessages.backend.gaveUpLogs')
@@ -134,14 +132,8 @@ const RPC_ERROR_ROWS: RpcErrorRow[] = [
(code, text) => (code === RPC_SESSION_NOT_FOUND || code === undefined) && SESSION_NOT_FOUND_RE.test(text),
() => t('userMessages.rpc.sessionNotFound')
],
- [
- (_code, text) => NOT_CONNECTED_RE.test(text),
- () => t('userMessages.rpc.notConnected')
- ],
- [
- (_code, text) => TIMED_OUT_RE.exec(text),
- m => t('userMessages.rpc.timedOut', m?.[1] ?? '?')
- ]
+ [(_code, text) => NOT_CONNECTED_RE.test(text), () => t('userMessages.rpc.notConnected')],
+ [(_code, text) => TIMED_OUT_RE.exec(text), m => t('userMessages.rpc.timedOut', m?.[1] ?? '?')]
]
let rpcErrorLogSink: ((line: string) => void) | null = null
@@ -191,9 +183,7 @@ export const describeSlashExecError = (command: string, err: unknown): string =>
if (/slash worker (?:exited|closed pipe|start failed)/.test(text)) {
const detail = detailLine(text.replace(/^slash worker (?:exited|closed pipe:?|start failed:?)\s*/, ''))
- return [t('userMessages.rpc.slashCrashed', command), detail]
- .filter(Boolean)
- .join('\n')
+ return [t('userMessages.rpc.slashCrashed', command), detail].filter(Boolean).join('\n')
}
return describeRpcError(err)
diff --git a/ui-tui/src/components/modelPicker.tsx b/ui-tui/src/components/modelPicker.tsx
index 4115d58f04c..4ffe265fdd8 100644
--- a/ui-tui/src/components/modelPicker.tsx
+++ b/ui-tui/src/components/modelPicker.tsx
@@ -835,9 +835,7 @@ export function ModelPicker({
<Text color={t.color.muted} wrap="truncate-end">
{persistLine}
</Text>
- <OverlayHint t={t}>
- {models.length ? M.modelStage.hint : M.modelStage.emptyHint}
- </OverlayHint>
+ <OverlayHint t={t}>{models.length ? M.modelStage.hint : M.modelStage.emptyHint}</OverlayHint>
</Box>
)
}
diff --git a/ui-tui/src/components/petPicker.tsx b/ui-tui/src/components/petPicker.tsx
index dfc1c1681c9..047a9a9c78b 100644
--- a/ui-tui/src/components/petPicker.tsx
+++ b/ui-tui/src/components/petPicker.tsx
@@ -145,7 +145,8 @@ export function PetPicker({ gw, maxWidth, onClose, t }: PetPickerProps) {
</Text>
<Text color={t.color.muted} wrap="truncate-end">
- {query ? C.filter(query) : C.typeToFilter} · {view.length === 1 ? P.petCountOne(1) : P.petCountOther(view.length)}
+ {query ? C.filter(query) : C.typeToFilter} ·{' '}
+ {view.length === 1 ? P.petCountOne(1) : P.petCountOther(view.length)}
</Text>
{offset > 0 && <Text color={t.color.muted}>{C.moreAbove(offset)}</Text>}
@@ -173,7 +174,9 @@ export function PetPicker({ gw, maxWidth, onClose, t }: PetPickerProps) {
})
)}
- {offset + VISIBLE < view.length && <Text color={t.color.muted}>{C.moreBelow(view.length - offset - VISIBLE)}</Text>}
+ {offset + VISIBLE < view.length && (
+ <Text color={t.color.muted}>{C.moreBelow(view.length - offset - VISIBLE)}</Text>
+ )}
{err ? <Text color={t.color.label}>{C.error(err)}</Text> : null}
{busy ? <Text color={t.color.accent}>{P.adopting}</Text> : null}
diff --git a/ui-tui/src/i18n/en/userMessages.ts b/ui-tui/src/i18n/en/userMessages.ts
index 652f8640087..64a313e14fa 100644
--- a/ui-tui/src/i18n/en/userMessages.ts
+++ b/ui-tui/src/i18n/en/userMessages.ts
@@ -12,8 +12,7 @@ export const userMessagesEn = {
details: (text: string) => `Details: ${text}`,
backend: {
- restarting:
- 'Hermes stopped unexpectedly — restarting and reopening your chat (the reply in progress was lost).',
+ restarting: 'Hermes stopped unexpectedly — restarting and reopening your chat (the reply in progress was lost).',
restartingActivity: 'Hermes stopped unexpectedly · restarting…',
connectionLost: 'Connection to Hermes lost — reconnecting and reopening your chat…',
connectionLostActivity: 'connection lost · reconnecting…',
@@ -86,7 +85,10 @@ export const userMessagesEn = {
hint: 'Try /retry; if it persists, switch with /model.',
hintNoRetry: 'Pick another model with /model; if it persists, switch with /model.'
},
- modelNotFound: { title: 'The model provider does not know this model', hint: 'Pick another model with /model.' },
+ modelNotFound: {
+ title: 'The model provider does not know this model',
+ hint: 'Pick another model with /model.'
+ },
overloaded: { title: 'The model provider is overloaded', hint: 'Wait a moment, then /retry.' },
payloadTooLarge: { title: 'The request was too large for this model', hint: 'Run /compress, then /retry.' },
providerPolicyBlocked: {
diff --git a/ui-tui/src/lib/billingDialog.ts b/ui-tui/src/lib/billingDialog.ts
index 93536ae1c24..2a3f65ea937 100644
--- a/ui-tui/src/lib/billingDialog.ts
+++ b/ui-tui/src/lib/billingDialog.ts
@@ -31,7 +31,9 @@ export function billingDialogCopy(block: BillingBlock): BillingDialogCopy {
return {
cancelLabel: t('libText.billingDialog.dismiss'),
- confirmLabel: block.billing_url ? t('libText.billingDialog.openBillingPage') : t('libText.billingDialog.switchProvider'),
+ confirmLabel: block.billing_url
+ ? t('libText.billingDialog.openBillingPage')
+ : t('libText.billingDialog.switchProvider'),
detail: t('libText.billingDialog.providerDetail', label),
title: t('libText.billingDialog.providerTitle', label)
}
diff --git a/ui-tui/src/lib/subagentTree.ts b/ui-tui/src/lib/subagentTree.ts
index 79064ed5858..edc6e5b665e 100644
--- a/ui-tui/src/lib/subagentTree.ts
+++ b/ui-tui/src/lib/subagentTree.ts
@@ -246,7 +246,10 @@ export function formatSummary(totals: SubagentAggregate): string {
if (totals.totalTools > 0) {
pieces.push(
- t(totals.totalTools === 1 ? 'libText.subagentTree.toolsOne' : 'libText.subagentTree.toolsOther', totals.totalTools)
+ t(
+ totals.totalTools === 1 ? 'libText.subagentTree.toolsOne' : 'libText.subagentTree.toolsOther',
+ totals.totalTools
+ )
)
}
diff --git a/ui-tui/src/lib/terminalSetup.ts b/ui-tui/src/lib/terminalSetup.ts
index 30e3ba60454..46fb4b741d8 100644
--- a/ui-tui/src/lib/terminalSetup.ts
+++ b/ui-tui/src/lib/terminalSetup.ts
@@ -431,11 +431,15 @@ export async function configureTerminalKeybindings(
const parts: string[] = []
if (added) {
- parts.push(t(added === 1 ? 'libText.terminalSetup.addedOne' : 'libText.terminalSetup.addedOther', added, meta.label))
+ parts.push(
+ t(added === 1 ? 'libText.terminalSetup.addedOne' : 'libText.terminalSetup.addedOther', added, meta.label)
+ )
}
if (migrated) {
- parts.push(t(migrated === 1 ? 'libText.terminalSetup.migratedOne' : 'libText.terminalSetup.migratedOther', migrated))
+ parts.push(
+ t(migrated === 1 ? 'libText.terminalSetup.migratedOne' : 'libText.terminalSetup.migratedOther', migrated)
+ )
}
return {