mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-26 06:01:49 +00:00
chore(tui): /clean pass — inline one-off locals, tighten ConfirmPrompt
- providers.ts: drop the `dup` intermediate, fold the ternary inline - paths.ts (fmtCwdBranch): inline `b` into the `tag` template - prompts.tsx (ConfirmPrompt): hoist a single `lower = ch.toLowerCase()`, collapse the three early-return branches into two, drop the redundant bounds checks on arrow-key handlers (setSel is idempotent at 0/1), inline the `confirmLabel`/`cancelLabel` defaults at the use site - modelPicker.tsx / config/env.ts / providers.test.ts: auto-formatter reflows picked up by `npm run fix` - useInputHandlers.ts: drop the stray blank line that was tripping perfectionist/sort-imports (pre-existing lint error)
This commit is contained in:
parent
ab6eaaff26
commit
596280a40b
7 changed files with 28 additions and 41 deletions
|
|
@ -5,13 +5,7 @@ export const providerDisplayNames = (providers: readonly { name: string; slug: s
|
|||
counts.set(p.name, (counts.get(p.name) ?? 0) + 1)
|
||||
}
|
||||
|
||||
return providers.map(p => {
|
||||
const dup = (counts.get(p.name) ?? 0) > 1
|
||||
|
||||
if (!dup || !p.slug || p.slug === p.name) {
|
||||
return p.name
|
||||
}
|
||||
|
||||
return `${p.name} (${p.slug})`
|
||||
})
|
||||
return providers.map(p =>
|
||||
(counts.get(p.name) ?? 0) > 1 && p.slug && p.slug !== p.name ? `${p.name} (${p.slug})` : p.name
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue