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

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
hermes-seaeye[bot] 2026-08-08 16:55:45 +00:00 committed by GitHub
parent 31cedb4830
commit 2389564d83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 17 deletions

View File

@ -85,14 +85,7 @@ const POSIX_ABSOLUTE_PATH_RE = /^\/(?!\/)/
// (docker/ssh/singularity/modal/...) cannot see the desktop's host paths —
// they must be crossed as bytes, like remote attachments. Mirrors the
// container_backend set in tools/terminal_tool.py::_get_env_config.
const CONTAINER_TERMINAL_BACKENDS = new Set([
'docker',
'ssh',
'singularity',
'modal',
'daytona',
'vercel_sandbox'
])
const CONTAINER_TERMINAL_BACKENDS = new Set(['docker', 'ssh', 'singularity', 'modal', 'daytona', 'vercel_sandbox'])
// `mode: local` means the gateway was launched locally, not necessarily that
// Electron and the gateway share a filesystem. Windows Desktop can front a
@ -104,6 +97,7 @@ function attachmentPathNeedsUpload(path: string, backendCwd?: null | string, ter
if (CONTAINER_TERMINAL_BACKENDS.has((terminalBackend || '').trim().toLowerCase())) {
return true
}
return WINDOWS_ABSOLUTE_PATH_RE.test(path.trim()) && POSIX_ABSOLUTE_PATH_RE.test(backendCwd?.trim() || '')
}

View File

@ -17,7 +17,12 @@ describe('tokenizeSearchText', () => {
})
describe('scoreSlashMenuItem', () => {
const item = { aliases: ['recap', 'summary'], description: 'Turn session recaps on/off', id: 'recaps', label: 'recaps' }
const item = {
aliases: ['recap', 'summary'],
description: 'Turn session recaps on/off',
id: 'recaps',
label: 'recaps'
}
it('scores exact name matches at tier 0', () => {
expect(scoreSlashMenuItem(item, 'recaps')).toBe(0)
@ -65,11 +70,7 @@ describe('rankSlashItems', () => {
})
it('ranks name matches above description matches and drops non-matches', () => {
const ranked = rankSlashItems(
[{ help: 'model picker widget', id: 'gallery' }, ...apps],
'/model',
toScoreItem
)
const ranked = rankSlashItems([{ help: 'model picker widget', id: 'gallery' }, ...apps], '/model', toScoreItem)
expect(ranked.map(app => app.id)).toEqual(['models', 'gallery'])
})

View File

@ -51,9 +51,7 @@ function scoreFields(fields: string[], query: string, offset: number): number {
/** Score one item against a normalized query. Lower is better; Infinity = no match. */
export function scoreSlashMenuItem(item: SlashScoreItem, query: string): number {
const commandFields = [item.id, item.label ?? '', ...(item.aliases ?? [])]
.filter(Boolean)
.flatMap(tokenizeSearchText)
const commandFields = [item.id, item.label ?? '', ...(item.aliases ?? [])].filter(Boolean).flatMap(tokenizeSearchText)
const descriptionFields = tokenizeSearchText(item.description ?? '')