mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-24 16:54:43 +00:00
fmt(js): npm run fix on merge (#69939)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
3e163d29bd
commit
7c9d05267c
7 changed files with 38 additions and 25 deletions
|
|
@ -16,6 +16,7 @@ describe('MarkdownTextContent remote images', () => {
|
|||
|
||||
throw new Error(`unexpected path ${path}`)
|
||||
})
|
||||
|
||||
let originalDesktop: typeof window.hermesDesktop
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
|
|||
|
|
@ -130,9 +130,7 @@ function readFileDisplayTarget(args: Record<string, unknown>, result: Record<str
|
|||
|
||||
function shellCommand(args: Record<string, unknown>): string {
|
||||
return (
|
||||
firstStringField(args, ['context', 'preview']) ||
|
||||
firstStringField(args, ['command', 'code']) ||
|
||||
contextValue(args)
|
||||
firstStringField(args, ['context', 'preview']) || firstStringField(args, ['command', 'code']) || contextValue(args)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -1389,8 +1387,11 @@ export function buildToolView(part: ToolPart, inlineDiff: string): ToolView {
|
|||
|
||||
const searchHits =
|
||||
part.toolName === 'web_search' && status !== 'error' ? extractSearchResults(part.result) : undefined
|
||||
|
||||
const searchQuery =
|
||||
part.toolName === 'web_search' ? firstStringField(argsRecord, ['search_term', 'query']) || contextValue(argsRecord) : ''
|
||||
part.toolName === 'web_search'
|
||||
? firstStringField(argsRecord, ['search_term', 'query']) || contextValue(argsRecord)
|
||||
: ''
|
||||
|
||||
const resultCount = status === 'error' ? null : toolResultCount(part, argsRecord, resultRecord)
|
||||
|
||||
|
|
|
|||
|
|
@ -391,14 +391,14 @@ function ToolEntry({ part }: ToolEntryProps) {
|
|||
|
||||
const hasExpandableContent = Boolean(
|
||||
view.imageUrl ||
|
||||
view.inlineDiff ||
|
||||
showDetail ||
|
||||
hasSearchHits ||
|
||||
view.stdout ||
|
||||
view.stderr ||
|
||||
view.terminalCommand ||
|
||||
view.terminalExitCode !== undefined ||
|
||||
toolViewMode === 'technical'
|
||||
view.inlineDiff ||
|
||||
showDetail ||
|
||||
hasSearchHits ||
|
||||
view.stdout ||
|
||||
view.stderr ||
|
||||
view.terminalCommand ||
|
||||
view.terminalExitCode !== undefined ||
|
||||
toolViewMode === 'technical'
|
||||
)
|
||||
|
||||
// copyAction reads the uncapped view.detail; clampForDisplay below only bounds
|
||||
|
|
@ -649,7 +649,9 @@ function TerminalTranscript({ command, exitCode }: TerminalTranscriptProps) {
|
|||
<div className="flex min-w-0 items-center gap-2 rounded-[0.25rem] border border-(--ui-stroke-tertiary) bg-(--ui-bg-quinary) px-2 py-1.5 font-mono text-[0.7rem] leading-relaxed">
|
||||
{command && (
|
||||
<code className="min-w-0 flex-1 whitespace-pre-wrap wrap-anywhere text-(--ui-text-secondary)">
|
||||
<span aria-hidden className="select-none text-(--ui-accent-secondary)">$ </span>
|
||||
<span aria-hidden className="select-none text-(--ui-accent-secondary)">
|
||||
${' '}
|
||||
</span>
|
||||
{command}
|
||||
</code>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -215,9 +215,7 @@ function NotificationItem({ notification }: { notification: AppNotification }) {
|
|||
{notification.title && <AlertTitle className="col-start-auto">{notification.title}</AlertTitle>}
|
||||
<AlertDescription className="col-start-auto">
|
||||
<p className="m-0">{renderMessage(notification.message, accent)}</p>
|
||||
{notification.meta && (
|
||||
<p className="m-0 text-xs text-muted-foreground tabular-nums">{notification.meta}</p>
|
||||
)}
|
||||
{notification.meta && <p className="m-0 text-xs text-muted-foreground tabular-nums">{notification.meta}</p>}
|
||||
{hasDetail && <NotificationDetail detail={notification.detail || ''} />}
|
||||
{notification.action && (
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -558,7 +558,8 @@ describe('upsertToolPart', () => {
|
|||
)
|
||||
|
||||
const terminalParts = completed.filter(
|
||||
(part): part is Extract<ChatMessagePart, { type: 'tool-call' }> => part.type === 'tool-call' && part.toolName === 'terminal'
|
||||
(part): part is Extract<ChatMessagePart, { type: 'tool-call' }> =>
|
||||
part.type === 'tool-call' && part.toolName === 'terminal'
|
||||
)
|
||||
|
||||
expect(terminalParts).toHaveLength(1)
|
||||
|
|
@ -941,10 +942,7 @@ describe('collectUnspokenTurnSpeech', () => {
|
|||
})
|
||||
|
||||
it('reports pending from the newest assistant bubble even when it has no text yet', () => {
|
||||
const messages = [
|
||||
assistant('a1', 'Narration done.', { interim: true }),
|
||||
assistant('a2', '', { pending: true })
|
||||
]
|
||||
const messages = [assistant('a1', 'Narration done.', { interim: true }), assistant('a2', '', { pending: true })]
|
||||
|
||||
const speech = collectUnspokenTurnSpeech(messages, null)
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,10 @@ export interface UnspokenTurnSpeech {
|
|||
* join is a sentence boundary for the server's cutter, so a sealed bubble's
|
||||
* tail is flushed as soon as the next bubble starts.
|
||||
*/
|
||||
export function collectUnspokenTurnSpeech(messages: ChatMessage[], lastSpokenId: string | null): UnspokenTurnSpeech | null {
|
||||
export function collectUnspokenTurnSpeech(
|
||||
messages: ChatMessage[],
|
||||
lastSpokenId: string | null
|
||||
): UnspokenTurnSpeech | null {
|
||||
const spokenIndex = lastSpokenId ? messages.findLastIndex(m => m.id === lastSpokenId) : -1
|
||||
|
||||
let id: string | null = null
|
||||
|
|
|
|||
|
|
@ -52,7 +52,13 @@ test('sticky notices never auto-dismiss', () => {
|
|||
})
|
||||
|
||||
test('ttl notice carries its ttl_ms as the duration', () => {
|
||||
const toast = noticeToToast({ key: 'credits.restored', kind: 'ttl', level: 'success', text: '✓ restored', ttl_ms: 8000 })
|
||||
const toast = noticeToToast({
|
||||
key: 'credits.restored',
|
||||
kind: 'ttl',
|
||||
level: 'success',
|
||||
text: '✓ restored',
|
||||
ttl_ms: 8000
|
||||
})
|
||||
expect(toast?.durationMs).toBe(8000)
|
||||
})
|
||||
|
||||
|
|
@ -118,8 +124,12 @@ test('usageFraction derives $used / $cap from the notice text', () => {
|
|||
test('usage accent stays muted below 75%, then ramps orange → red', () => {
|
||||
expect(noticeAccent(usage({ text: "• You've used $10.00 of your $20.00 cap" }))).toBeUndefined() // 50%
|
||||
expect(noticeAccent(usage({ text: "• You've used $14.80 of your $20.00 cap" }))).toBeUndefined() // 74%
|
||||
expect(noticeAccent(usage({ level: 'warn', text: "⚠ You've used $15.00 of your $20.00 cap" }))).toBe('var(--ui-orange)') // 75%
|
||||
expect(noticeAccent(usage({ level: 'warn', text: "⚠ You've used $17.80 of your $20.00 cap" }))).toBe('var(--ui-orange)') // 89%
|
||||
expect(noticeAccent(usage({ level: 'warn', text: "⚠ You've used $15.00 of your $20.00 cap" }))).toBe(
|
||||
'var(--ui-orange)'
|
||||
) // 75%
|
||||
expect(noticeAccent(usage({ level: 'warn', text: "⚠ You've used $17.80 of your $20.00 cap" }))).toBe(
|
||||
'var(--ui-orange)'
|
||||
) // 89%
|
||||
expect(noticeAccent(usage({ level: 'warn', text: "⚠ You've used $18.00 of your $20.00 cap" }))).toBe('var(--ui-red)') // 90%
|
||||
expect(noticeAccent(usage({ level: 'warn', text: "⚠ You've used $20.00 of your $20.00 cap" }))).toBe('var(--ui-red)') // 100%
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue