fmt(js): npm run fix on merge (#92032)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
hermes-seaeye[bot]
2026-08-22 03:31:35 +00:00
committed by GitHub
parent 3cc7f220cd
commit 8286c46502
9 changed files with 33 additions and 41 deletions
+2 -5
View File
@@ -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)', () => {
@@ -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)
+1 -2
View File
@@ -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)
@@ -554,7 +554,12 @@ const ErrorRecoveryActions: FC = () => {
{remoteConnection ? copy.errorOpenDesktopLogs : copy.errorOpenLogs}
</button>
)}
<CopyButton appearance="inline" className="aui-error-action" label={copy.errorCopyDiagnostics} text={diagnosticsText} />
<CopyButton
appearance="inline"
className="aui-error-action"
label={copy.errorCopyDiagnostics}
text={diagnosticsText}
/>
</div>
)
}
+2 -1
View File
@@ -86,7 +86,8 @@ export const ar = defineLocale({
repairInstall: 'إصلاح التثبيت',
useLocalGateway: 'استخدام البوابة المحلية',
cloudDownTitle: 'عامل Nous Cloud معطّل',
cloudDownDescription: 'يعيد عامل السحابة المُدار من Nous الذي يتصل به هذا البوابة خطأً من الخادم. لا يمكن إعادة تشغيله من هنا — تحقق من حالته، أو بدّل إلى البوابة المحلية، أو احصل على الدعم.',
cloudDownDescription:
'يعيد عامل السحابة المُدار من Nous الذي يتصل به هذا البوابة خطأً من الخادم. لا يمكن إعادة تشغيله من هنا — تحقق من حالته، أو بدّل إلى البوابة المحلية، أو احصل على الدعم.',
cloudDownHint: 'تفتح الأزرار أدناه بوابة Nous (حالة المثيل وعناصر التحكم) أو Discord للحصول على الدعم.',
cloudDownCheckPortal: 'التحقق من حالة البوابة',
cloudDownDiscord: 'الحصول على مساعدة عبر Discord',
+2 -1
View File
@@ -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 取得協助',
+2 -1
View File
@@ -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 获取帮助',
@@ -7,7 +7,11 @@ import {
textColorLuma
} from './selection-copy-colors'
function makeCopyEvent(): { event: ClipboardEvent; setData: ReturnType<typeof vi.fn>; preventDefault: ReturnType<typeof vi.fn> } {
function makeCopyEvent(): {
event: ClipboardEvent
setData: ReturnType<typeof vi.fn>
preventDefault: ReturnType<typeof vi.fn>
} {
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('<p style="color: rgb(230, 237, 243); font-family: -apple-system, sans-serif">plain prose</p>')
const host = armSelection(
'<p style="color: rgb(230, 237, 243); font-family: -apple-system, sans-serif">plain prose</p>'
)
const html = serializeSelectionStructure(window.getSelection()!, document)
// Generic family on the wrapper: resolves to each platform's own face,
@@ -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()