Skip to content

The agent that grows with you

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

hermes-seaeye[bot]a726a4aee6dc
diff --git a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx
index 85e8957ee1b..a86446d3a16 100644
--- a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx
+++ b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx
@@ -367,6 +367,7 @@ describe('useGatewayBoot remote reconnect loop (real hook, fake socket)', () =>
// end-state assertion would pass anyway (the seed would run later in the
// same flush). The construction-time snapshot is what proves ordering.
let cwdAtConnect = ''
+
class RecordingSocket extends FakeWebSocket {
constructor(url: string) {
super(url)
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 3de644dc0fb..d1c926afc1a 100644
--- a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
+++ b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
@@ -500,6 +500,7 @@ export function useGatewayBoot({
progress: 95
})
publish(conn)
+
// Seed the workspace BEFORE the gateway opens: every session-restore
// path is gated on gatewayState === 'open', so nothing can be active yet
// and ensureDefaultWorkspaceCwd's live-session guard passes. The
diff --git a/apps/desktop/src/lib/time.test.ts b/apps/desktop/src/lib/time.test.ts
index 4c7c39829c2..daf34ec5216 100644
--- a/apps/desktop/src/lib/time.test.ts
+++ b/apps/desktop/src/lib/time.test.ts
@@ -1,6 +1,17 @@
import { describe, expect, it } from 'vitest'
-import { calendarBucket, DAY, fmtMonth, fmtMonthYear, formatAgo, HOUR, MINUTE, nominalDayStart, SECOND, sessionBucketLabel } from './time'
+import {
+ calendarBucket,
+ DAY,
+ fmtMonth,
+ fmtMonthYear,
+ formatAgo,
+ HOUR,
+ MINUTE,
+ nominalDayStart,
+ SECOND,
+ sessionBucketLabel
+} from './time'
const labels = {
ageNow: 'now',
@@ -123,12 +134,16 @@ describe('sessionBucketLabel', () => {
// any host locale (the formatters intentionally use the runtime locale).
const monthBucket = calendarBucket(secondsAt(2026, 2, 3), THU_NOON, 1)
- if (monthBucket.kind !== 'month') {throw new Error(`expected month bucket, got ${monthBucket.kind}`)}
+ if (monthBucket.kind !== 'month') {
+ throw new Error(`expected month bucket, got ${monthBucket.kind}`)
+ }
expect(sessionBucketLabel(monthBucket, labels)).toBe(fmtMonth.format(monthBucket.at))
const monthYearBucket = calendarBucket(secondsAt(2025, 11, 3), THU_NOON, 1)
- if (monthYearBucket.kind !== 'monthYear') {throw new Error(`expected monthYear bucket, got ${monthYearBucket.kind}`)}
+ if (monthYearBucket.kind !== 'monthYear') {
+ throw new Error(`expected monthYear bucket, got ${monthYearBucket.kind}`)
+ }
expect(sessionBucketLabel(monthYearBucket, labels)).toBe(fmtMonthYear.format(monthYearBucket.at))
})
})
diff --git a/ui-tui/src/__tests__/clipboard.test.ts b/ui-tui/src/__tests__/clipboard.test.ts
index 6ba55d0b559..a06a7348544 100644
--- a/ui-tui/src/__tests__/clipboard.test.ts
+++ b/ui-tui/src/__tests__/clipboard.test.ts
@@ -21,7 +21,12 @@ describe('readClipboardText', () => {
await expect(readClipboardText('win32', run)).resolves.toBe('from windows\r\n')
expect(run).toHaveBeenCalledWith(
'powershell',
- ['-NoProfile', '-NonInteractive', '-Command', '[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((Get-Clipboard -Raw)))'],
+ [
+ '-NoProfile',
+ '-NonInteractive',
+ '-Command',
+ '[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((Get-Clipboard -Raw)))'
+ ],
expect.objectContaining({ encoding: 'utf8', maxBuffer: 4 * 1024 * 1024, windowsHide: true })
)
})
@@ -35,7 +40,12 @@ describe('readClipboardText', () => {
)
expect(run).toHaveBeenCalledWith(
'powershell.exe',
- ['-NoProfile', '-NonInteractive', '-Command', '[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((Get-Clipboard -Raw)))'],
+ [
+ '-NoProfile',
+ '-NonInteractive',
+ '-Command',
+ '[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes((Get-Clipboard -Raw)))'
+ ],
expect.objectContaining({ encoding: 'utf8', maxBuffer: 4 * 1024 * 1024, windowsHide: true })
)
})
@@ -89,9 +99,9 @@ describe('readClipboardText', () => {
const b64 = Buffer.from(cjkText, 'utf8').toString('base64')
const run = vi.fn().mockResolvedValue({ stdout: b64 })
- await expect(
- readClipboardText('linux', run, { WSL_INTEROP: '/tmp/socket' } as NodeJS.ProcessEnv)
- ).resolves.toBe(cjkText)
+ await expect(readClipboardText('linux', run, { WSL_INTEROP: '/tmp/socket' } as NodeJS.ProcessEnv)).resolves.toBe(
+ cjkText
+ )
})
})
diff --git a/ui-tui/src/lib/clipboard.ts b/ui-tui/src/lib/clipboard.ts
index 13b557ea071..e6979daf2eb 100644
--- a/ui-tui/src/lib/clipboard.ts
+++ b/ui-tui/src/lib/clipboard.ts
@@ -3,6 +3,7 @@ import { promisify } from 'node:util'
const execFileAsync = promisify(execFile)
const CLIPBOARD_MAX_BUFFER = 4 * 1024 * 1024
+
// PowerShell read: base64-encode the clipboard content to avoid ANSI codepage
// corruption (same problem as the write path — see comment at line 94).
const POWERSHELL_READ_ARGS = [