mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-06 02:41:48 +00:00
This PR groups the TUI fixes that restore macOS Terminal usability and clean up the theme/composer regressions: - copy transcript selections on macOS drag-release so Terminal.app users can copy while mouse tracking is enabled - copy composer selections on macOS drag-release; composer selection is internal to TextInput and does not use the global Ink selection bus - keep IDE Cmd+C forwarding setup macOS-only, and make keybinding conflict checks respect simple when-clause overlap/negation - force truecolor before chalk initializes (unless NO_COLOR / FORCE_COLOR / HERMES_TUI_TRUECOLOR opt-outs apply) so the default banner keeps its gold/amber/bronze gradient in Terminal.app - move TUI surfaces onto semantic theme tokens and preserve skin prompt symbols as bare tokens with renderer-owned spacing - render focused placeholders as dim hint text in TTY mode instead of inverse/selected-looking synthetic cursor text
34 lines
825 B
TypeScript
34 lines
825 B
TypeScript
import { Box, Text } from '@hermes/ink'
|
|
import { useState } from 'react'
|
|
|
|
import type { Theme } from '../theme.js'
|
|
|
|
import { TextInput } from './textInput.js'
|
|
|
|
export function MaskedPrompt({ cols = 80, icon, label, onSubmit, sub, t }: MaskedPromptProps) {
|
|
const [value, setValue] = useState('')
|
|
|
|
return (
|
|
<Box flexDirection="column">
|
|
<Text bold color={t.color.warn}>
|
|
{icon} {label}
|
|
</Text>
|
|
|
|
{sub && <Text color={t.color.muted}> {sub}</Text>}
|
|
|
|
<Box>
|
|
<Text color={t.color.label}>{'> '}</Text>
|
|
<TextInput columns={Math.max(20, cols - 6)} mask="*" onChange={setValue} onSubmit={onSubmit} value={value} />
|
|
</Box>
|
|
</Box>
|
|
)
|
|
}
|
|
|
|
interface MaskedPromptProps {
|
|
cols?: number
|
|
icon: string
|
|
label: string
|
|
onSubmit: (v: string) => void
|
|
sub?: string
|
|
t: Theme
|
|
}
|