Skip to content

The agent that grows with you

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

hermes-seaeye[bot]e629c900a876
diff --git a/apps/desktop/electron/backend-ownership.test.ts b/apps/desktop/electron/backend-ownership.test.ts
index 1e3b519ede3..77a6e46e2e9 100644
--- a/apps/desktop/electron/backend-ownership.test.ts
+++ b/apps/desktop/electron/backend-ownership.test.ts
@@ -188,6 +188,7 @@ test('startup reap stops at the deadline and preserves the unprocessed records',
// Each probe is slow enough to blow a 1ms budget after the first entry.
matchesIdentity: async () => {
await new Promise(resolve => setTimeout(resolve, 10))
+
return false
},
stop,
@@ -209,6 +210,7 @@ test('startup reap preserves would-be-reaped records when the budget runs out',
const ownership = createOwnership(store, {
matchesIdentity: async () => {
await new Promise(resolve => setTimeout(resolve, 10))
+
return true
},
stop,
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index a9bb25a291f..d5ff39d6d8f 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -1439,7 +1439,9 @@ function readPersistedPoolLimits() {
})
if (fromEnv.maxBackends !== POOL_LIMITS_DEFAULTS.maxBackends || fromEnv.idleMs !== POOL_LIMITS_DEFAULTS.idleMs) {
- rememberLog(`[pool-limits] no saved file; using env-var overrides: maxBackends=${fromEnv.maxBackends}, idleMs=${fromEnv.idleMs}`)
+ rememberLog(
+ `[pool-limits] no saved file; using env-var overrides: maxBackends=${fromEnv.maxBackends}, idleMs=${fromEnv.idleMs}`
+ )
} else {
rememberLog('[pool-limits] no saved file and no env overrides; using defaults')
}
@@ -12315,9 +12317,7 @@ function teardownFailedLocalBackend(poolKey: string, entry: any): Promise<void>
await waitForBackendExit(child)
if (child && child.exitCode === null && child.signalCode === null) {
- throw new Error(
- `Profile backend for "${poolKey}" did not exit; keeping the local slot occupied.`
- )
+ throw new Error(`Profile backend for "${poolKey}" did not exit; keeping the local slot occupied.`)
}
releaseBackendChild(child)
diff --git a/apps/desktop/electron/pool-limits.test.ts b/apps/desktop/electron/pool-limits.test.ts
index 3dc86f0ed3d..5aff45f0883 100644
--- a/apps/desktop/electron/pool-limits.test.ts
+++ b/apps/desktop/electron/pool-limits.test.ts
@@ -1,6 +1,12 @@
import { describe, expect, it } from 'vitest'
-import { clampPoolLimits, parsePoolLimits, POOL_LIMITS_BOUNDS, POOL_LIMITS_DEFAULTS, POOL_LIMITS_MIN } from './pool-limits'
+import {
+ clampPoolLimits,
+ parsePoolLimits,
+ POOL_LIMITS_BOUNDS,
+ POOL_LIMITS_DEFAULTS,
+ POOL_LIMITS_MIN
+} from './pool-limits'
describe('parsePoolLimits', () => {
it('falls back to defaults for null/empty/corrupt input', () => {
diff --git a/apps/desktop/electron/pool-spawn-coordinator.test.ts b/apps/desktop/electron/pool-spawn-coordinator.test.ts
index 66f41f7b604..73b2291fe1e 100644
--- a/apps/desktop/electron/pool-spawn-coordinator.test.ts
+++ b/apps/desktop/electron/pool-spawn-coordinator.test.ts
@@ -6,10 +6,7 @@ import { fileURLToPath } from 'node:url'
import { test } from 'vitest'
-import {
- LocalBackendSpawnCoordinator,
- releaseLocalBackendSlotAfterExit
-} from './pool-spawn-coordinator'
+import { LocalBackendSpawnCoordinator, releaseLocalBackendSlotAfterExit } from './pool-spawn-coordinator'
const deferred = () => {
let resolve!: () => void
@@ -220,18 +217,9 @@ test('an invalid timeout never enqueues a waiter', async () => {
const coordinator = new LocalBackendSpawnCoordinator(1)
const releaseFirst = await coordinator.acquire('first')
- assert.throws(
- () => coordinator.request('invalid', { timeoutMs: 0 }),
- /timeout must be a positive number/
- )
- assert.throws(
- () => coordinator.request('invalid', { timeoutMs: Number.NaN }),
- /timeout must be a positive number/
- )
- assert.throws(
- () => coordinator.request('invalid', { timeoutMs: -5 }),
- /timeout must be a positive number/
- )
+ assert.throws(() => coordinator.request('invalid', { timeoutMs: 0 }), /timeout must be a positive number/)
+ assert.throws(() => coordinator.request('invalid', { timeoutMs: Number.NaN }), /timeout must be a positive number/)
+ assert.throws(() => coordinator.request('invalid', { timeoutMs: -5 }), /timeout must be a positive number/)
assert.equal(coordinator.activeCount, 1)
assert.equal(coordinator.queuedCount, 0)
@@ -268,7 +256,6 @@ test('a failed or repeated cleanup releases exactly one slot', async () => {
assert.equal(coordinator.activeCount, 0)
})
-
test('raising the limit at runtime drains queued waiters into the new slots', async () => {
const coordinator = new LocalBackendSpawnCoordinator(1)
const first = await coordinator.acquire('a')
diff --git a/apps/desktop/src/app/chat/right-rail/preview-file.tsx b/apps/desktop/src/app/chat/right-rail/preview-file.tsx
index 6c43c0cea43..a16d64f280b 100644
--- a/apps/desktop/src/app/chat/right-rail/preview-file.tsx
+++ b/apps/desktop/src/app/chat/right-rail/preview-file.tsx
@@ -347,9 +347,7 @@ function MarkdownCode({ className, children, ...props }: ComponentProps<'code'>)
const code = String(children).replace(/\n$/, '')
- const highlighted = (
- <ShikiHighlighter code={code} language={language} theme={SHIKI_THEME} />
- )
+ const highlighted = <ShikiHighlighter code={code} language={language} theme={SHIKI_THEME} />
// ```mermaid / ```svg fences route to the shared lazy renderers (same
// registry the chat transcript uses); everything else stays on Shiki.
diff --git a/apps/desktop/src/components/chat/shiki-block.tsx b/apps/desktop/src/components/chat/shiki-block.tsx
index aea72875e7c..3704185caf5 100644
--- a/apps/desktop/src/components/chat/shiki-block.tsx
+++ b/apps/desktop/src/components/chat/shiki-block.tsx
@@ -23,10 +23,7 @@ import { bundledLanguages, getSingletonHighlighter } from 'shiki'
import type { BundledLanguage, BundledTheme, Highlighter } from 'shiki'
import { createOnigurumaEngine } from 'shiki/engine/oniguruma'
-import {
- SHIKI_HIGHLIGHT_SCOPE,
- SHIKI_THEME
-} from '@/components/chat/shiki-config'
+import { SHIKI_HIGHLIGHT_SCOPE, SHIKI_THEME } from '@/components/chat/shiki-config'
import { highlightCache, highlightCacheKey } from '@/components/chat/shiki-highlight-cache'
/** Same debounce react-shiki's `delay` used to throttle highlight work with. */
@@ -108,11 +105,7 @@ async function highlightToHtml(
}
function escapeHtml(text: string): string {
- return text
- .replace(/&/g, '&amp;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;')
- .replace(/"/g, '&quot;')
+ return text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;')
}
/** Never let a highlight failure blank a block — degrade to escaped plain text. */
@@ -120,12 +113,7 @@ function plainTextHtml(code: string): string {
return `<pre class="shiki" style="background-color:transparent;margin:0"><code>${escapeHtml(code)}</code></pre>`
}
-export default function CachedShikiBlock({
- language,
- code,
- theme,
- colorReplacements
-}: CachedShikiBlockProps) {
+export default function CachedShikiBlock({ language, code, theme, colorReplacements }: CachedShikiBlockProps) {
const themeConfig = theme ?? SHIKI_THEME
const replacements = colorReplacements ?? NO_COLOR_REPLACEMENTS