From 2389564d83f5e31a293727f471631dab46601e2b Mon Sep 17 00:00:00 2001 From: "hermes-seaeye[bot]" <307254004+hermes-seaeye[bot]@users.noreply.github.com> Date: Sat, 8 Aug 2026 16:55:45 +0000 Subject: [PATCH] fmt(js): `npm run fix` on merge (#81849) Co-authored-by: github-actions[bot] --- .../app/session/hooks/use-prompt-actions/index.ts | 10 ++-------- ui-tui/src/app/slash/fuzzyScore.test.ts | 13 +++++++------ ui-tui/src/app/slash/fuzzyScore.ts | 4 +--- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts index 9811c678fa0a0..5c9c9345b6c42 100644 --- a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts +++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts @@ -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() || '') } diff --git a/ui-tui/src/app/slash/fuzzyScore.test.ts b/ui-tui/src/app/slash/fuzzyScore.test.ts index e3acda45740ed..d64b80f412709 100644 --- a/ui-tui/src/app/slash/fuzzyScore.test.ts +++ b/ui-tui/src/app/slash/fuzzyScore.test.ts @@ -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']) }) diff --git a/ui-tui/src/app/slash/fuzzyScore.ts b/ui-tui/src/app/slash/fuzzyScore.ts index 3d721c3c97743..51b3d55f8fe77 100644 --- a/ui-tui/src/app/slash/fuzzyScore.ts +++ b/ui-tui/src/app/slash/fuzzyScore.ts @@ -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 ?? '')