mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-05 02:31:47 +00:00
feat: split apart main.tsx
This commit is contained in:
parent
2818dd8611
commit
bbba9ed4f2
16 changed files with 1710 additions and 1653 deletions
5
ui-tui/src/lib/messages.ts
Normal file
5
ui-tui/src/lib/messages.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import type { Msg, Role } from '../types.js'
|
||||
|
||||
export function upsert(prev: Msg[], role: Role, text: string): Msg[] {
|
||||
return prev.at(-1)?.role === role ? [...prev.slice(0, -1), { role, text }] : [...prev, { role, text }]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue