From 8286c46502e1f59eafdfabcf5af998024f64dfb8 Mon Sep 17 00:00:00 2001 From: "hermes-seaeye[bot]" <307254004+hermes-seaeye[bot]@users.noreply.github.com> Date: Sat, 22 Aug 2026 03:31:35 +0000 Subject: [PATCH] fmt(js): `npm run fix` on merge (#92032) Co-authored-by: github-actions[bot] --- apps/desktop/electron/backend-health.test.ts | 7 ++--- .../electron/connection-config.test.ts | 30 ++++--------------- apps/desktop/electron/main.ts | 3 +- .../assistant-ui/thread/assistant-message.tsx | 7 ++++- apps/desktop/src/i18n/ar.ts | 3 +- apps/desktop/src/i18n/zh-hant.ts | 3 +- apps/desktop/src/i18n/zh.ts | 3 +- .../src/lib/selection-copy-colors.test.ts | 10 +++++-- apps/desktop/src/lib/selection-copy-colors.ts | 8 +++-- 9 files changed, 33 insertions(+), 41 deletions(-) diff --git a/apps/desktop/electron/backend-health.test.ts b/apps/desktop/electron/backend-health.test.ts index d1dd26815e..a23ba5a73b 100644 --- a/apps/desktop/electron/backend-health.test.ts +++ b/apps/desktop/electron/backend-health.test.ts @@ -372,7 +372,7 @@ test('isServerSideHttpError detects 502/503/504', () => { // Non-HTTP errors (timeouts, network failures) don't match the pattern assert.equal(isServerSideHttpError(new Error('connect ECONNREFUSED')), null) assert.equal(isServerSideHttpError(null), null) - assert.equal(isServerSideHttpError('503: something'), null) // not an Error + assert.equal(isServerSideHttpError('503: something'), null) // not an Error }) test('isNousCloudAgentUrl detects cloud agent hosts', () => { @@ -504,10 +504,7 @@ test('makeNousCloudBackendDownError produces the Cloud shape and preserves cause test('makeNousCloudBackendDownError returns null for a Cloud 401 (routes to reauth)', () => { const err = new Error('Unauthorized') as any err.statusCode = 401 - assert.equal( - makeNousCloudBackendDownError('https://ares-3009.agents.nousresearch.com', err), - null - ) + assert.equal(makeNousCloudBackendDownError('https://ares-3009.agents.nousresearch.com', err), null) }) test('makeNousCloudBackendDownError returns null for a non-Cloud 503 (generic remote failure)', () => { diff --git a/apps/desktop/electron/connection-config.test.ts b/apps/desktop/electron/connection-config.test.ts index b547889797..36a042c6d3 100644 --- a/apps/desktop/electron/connection-config.test.ts +++ b/apps/desktop/electron/connection-config.test.ts @@ -1173,11 +1173,7 @@ test('gatewayTicketFailure preserves a structured 503 statusCode as a transport const source = new Error('upstream unavailable') as any source.statusCode = 503 - const wrapped = gatewayTicketFailure( - source, - 'auth message', - 'transport message' - ) + const wrapped = gatewayTicketFailure(source, 'auth message', 'transport message') assert.equal(wrapped.message, 'transport message') assert.equal((wrapped as any).statusCode, 503) @@ -1190,11 +1186,7 @@ test('gatewayTicketFailure keeps 401 and 403 as reauth with needsOauthLogin', () const source = new Error(`HTTP ${code}`) as any source.statusCode = code - const wrapped = gatewayTicketFailure( - source, - 'auth message', - 'transport message' - ) + const wrapped = gatewayTicketFailure(source, 'auth message', 'transport message') assert.equal(wrapped.message, 'auth message') assert.equal((wrapped as any).needsOauthLogin, true) @@ -1209,11 +1201,7 @@ test('gatewayTicketFailure only copies an integer statusCode, not a message pref // boundary. The wrapper must not invent an integer from the message. const source = new Error('503: Service Unavailable') as any - const wrapped = gatewayTicketFailure( - source, - 'auth message', - 'transport message' - ) + const wrapped = gatewayTicketFailure(source, 'auth message', 'transport message') assert.equal((wrapped as any).statusCode, undefined) assert.equal((wrapped as any).needsOauthLogin, undefined) @@ -1241,11 +1229,7 @@ test('OAuth ticket-mint 503 surfaces the Cloud-down error (startup boundary)', ( return } - const wrapped = gatewayTicketFailure( - ticketErr, - 'auth', - 'transport' - ) + const wrapped = gatewayTicketFailure(ticketErr, 'auth', 'transport') assert.fail(`expected Cloud-down classification, got wrapper: ${wrapped.message}`) }) @@ -1258,11 +1242,7 @@ test('OAuth ticket-mint 401 stays on the reauth path (never Cloud-down)', () => const cloudError = makeNousCloudBackendDownError(baseUrl, ticketErr) assert.equal(cloudError, null, 'a 401 must not become a Cloud-down error') - const wrapped = gatewayTicketFailure( - ticketErr, - 'auth message', - 'transport message' - ) + const wrapped = gatewayTicketFailure(ticketErr, 'auth message', 'transport message') assert.equal(wrapped.message, 'auth message') assert.equal((wrapped as any).needsOauthLogin, true) diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts index c7b3025bf6..e3087bdcb9 100644 --- a/apps/desktop/electron/main.ts +++ b/apps/desktop/electron/main.ts @@ -10911,8 +10911,7 @@ async function startHermes() { // boundary when present, so the renderer overlay can key on it rather than // re-classifying the message string. main owns classification; the renderer // only consumes the structured result (#85335). - const isCloudBackendDown = - Boolean(error && typeof error === 'object' && (error as any).isCloudBackendDown === true) + const isCloudBackendDown = Boolean(error && typeof error === 'object' && (error as any).isCloudBackendDown === true) const statusCode = Number( error && typeof error === 'object' && Number.isInteger((error as any).statusCode) diff --git a/apps/desktop/src/components/assistant-ui/thread/assistant-message.tsx b/apps/desktop/src/components/assistant-ui/thread/assistant-message.tsx index e13be5488c..84bc87c475 100644 --- a/apps/desktop/src/components/assistant-ui/thread/assistant-message.tsx +++ b/apps/desktop/src/components/assistant-ui/thread/assistant-message.tsx @@ -554,7 +554,12 @@ const ErrorRecoveryActions: FC = () => { {remoteConnection ? copy.errorOpenDesktopLogs : copy.errorOpenLogs} )} - + ) } diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts index e029b9f1bf..a30db33914 100644 --- a/apps/desktop/src/i18n/ar.ts +++ b/apps/desktop/src/i18n/ar.ts @@ -86,7 +86,8 @@ export const ar = defineLocale({ repairInstall: 'إصلاح التثبيت', useLocalGateway: 'استخدام البوابة المحلية', cloudDownTitle: 'عامل Nous Cloud معطّل', - cloudDownDescription: 'يعيد عامل السحابة المُدار من Nous الذي يتصل به هذا البوابة خطأً من الخادم. لا يمكن إعادة تشغيله من هنا — تحقق من حالته، أو بدّل إلى البوابة المحلية، أو احصل على الدعم.', + cloudDownDescription: + 'يعيد عامل السحابة المُدار من Nous الذي يتصل به هذا البوابة خطأً من الخادم. لا يمكن إعادة تشغيله من هنا — تحقق من حالته، أو بدّل إلى البوابة المحلية، أو احصل على الدعم.', cloudDownHint: 'تفتح الأزرار أدناه بوابة Nous (حالة المثيل وعناصر التحكم) أو Discord للحصول على الدعم.', cloudDownCheckPortal: 'التحقق من حالة البوابة', cloudDownDiscord: 'الحصول على مساعدة عبر Discord', diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts index 9178997e1e..593ab6bdb4 100644 --- a/apps/desktop/src/i18n/zh-hant.ts +++ b/apps/desktop/src/i18n/zh-hant.ts @@ -101,7 +101,8 @@ export const zhHant = defineLocale({ signOutAndSignIn: '登出並重新登入', remoteFailureHint: '在「閘道設定」中檢查閘道 URL 與登入,或切換至本機閘道。', cloudDownTitle: 'Nous Cloud 代理已停機', - cloudDownDescription: '此閘道連線的 Nous 託管雲端代理正在回傳伺服器錯誤。無法在此處重新啟動——請檢查其狀態、切換至本機閘道,或取得支援。', + cloudDownDescription: + '此閘道連線的 Nous 託管雲端代理正在回傳伺服器錯誤。無法在此處重新啟動——請檢查其狀態、切換至本機閘道,或取得支援。', cloudDownHint: '使用下方按鈕開啟 Nous Portal(檢視執行個體狀態與操作)或加入 Discord 取得支援。', cloudDownCheckPortal: '查看 Portal 狀態', cloudDownDiscord: '在 Discord 取得協助', diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts index 5423d13af8..4fa78ec6a0 100644 --- a/apps/desktop/src/i18n/zh.ts +++ b/apps/desktop/src/i18n/zh.ts @@ -101,7 +101,8 @@ export const zh: Translations = { signOutAndSignIn: '退出并重新登录', remoteFailureHint: '在“网关设置”中检查网关 URL 和登录,或切换到本地网关。', cloudDownTitle: 'Nous Cloud 代理已宕机', - cloudDownDescription: '此网关连接的 Nous 托管云代理正在返回服务器错误。无法在此处重启——请检查其状态、切换到本地网关或获取支持。', + cloudDownDescription: + '此网关连接的 Nous 托管云代理正在返回服务器错误。无法在此处重启——请检查其状态、切换到本地网关或获取支持。', cloudDownHint: '使用下方按钮打开 Nous Portal(查看实例状态与操作)或加入 Discord 获取支持。', cloudDownCheckPortal: '查看 Portal 状态', cloudDownDiscord: '在 Discord 获取帮助', diff --git a/apps/desktop/src/lib/selection-copy-colors.test.ts b/apps/desktop/src/lib/selection-copy-colors.test.ts index 54e3d4f3f1..a7ceab5e2e 100644 --- a/apps/desktop/src/lib/selection-copy-colors.test.ts +++ b/apps/desktop/src/lib/selection-copy-colors.test.ts @@ -7,7 +7,11 @@ import { textColorLuma } from './selection-copy-colors' -function makeCopyEvent(): { event: ClipboardEvent; setData: ReturnType; preventDefault: ReturnType } { +function makeCopyEvent(): { + event: ClipboardEvent + setData: ReturnType + preventDefault: ReturnType +} { const event = new Event('copy', { bubbles: true, cancelable: true }) as ClipboardEvent const setData = vi.fn() const preventDefault = vi.fn() @@ -160,7 +164,9 @@ describe('serializeSelectionStructure', () => { }) it('anchors a generic sans family so rich-text receivers keep their own font', () => { - const host = armSelection('

plain prose

') + const host = armSelection( + '

plain prose

' + ) const html = serializeSelectionStructure(window.getSelection()!, document) // Generic family on the wrapper: resolves to each platform's own face, diff --git a/apps/desktop/src/lib/selection-copy-colors.ts b/apps/desktop/src/lib/selection-copy-colors.ts index de9d63b9a4..944c4073ed 100644 --- a/apps/desktop/src/lib/selection-copy-colors.ts +++ b/apps/desktop/src/lib/selection-copy-colors.ts @@ -43,8 +43,7 @@ const srgbChannelValue = (raw: string): number => { return v.endsWith('%') ? (Number.parseFloat(v) / 100) * 255 : Number.parseFloat(v) * 255 } -const alphaValue = (raw: string): number => - raw.endsWith('%') ? Number.parseFloat(raw) / 100 : Number.parseFloat(raw) +const alphaValue = (raw: string): number => (raw.endsWith('%') ? Number.parseFloat(raw) / 100 : Number.parseFloat(raw)) function expandHex(hex: string): [number, number, number, number] | null { const h = hex.slice(1) @@ -175,7 +174,10 @@ export function selectionInkLuma(sel: Selection, doc: Document): number | null { for (let i = 0; i < sel.rangeCount && lumas.length < MAX_PROBE_NODES; i++) { const range = sel.getRangeAt(i) const root = range.commonAncestorContainer - const walker = doc.createTreeWalker(root.nodeType === 1 ? root : root.parentElement ?? doc.body, NodeFilter.SHOW_TEXT) + const walker = doc.createTreeWalker( + root.nodeType === 1 ? root : (root.parentElement ?? doc.body), + NodeFilter.SHOW_TEXT + ) let node = walker.nextNode()