mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-14 04:02:26 +00:00
feat(tui): archive todos at turn end with incomplete hint
This commit is contained in:
parent
319c1c1691
commit
c78b528125
12 changed files with 948 additions and 70 deletions
|
|
@ -40,14 +40,22 @@ export const patchTurnState = (next: Partial<TurnState> | ((state: TurnState) =>
|
|||
|
||||
export const toggleTodoCollapsed = () => patchTurnState(state => ({ ...state, todoCollapsed: !state.todoCollapsed }))
|
||||
|
||||
export const archiveDoneTodos = () => {
|
||||
export const archiveDoneTodos = () => archiveTodosAtTurnEnd()
|
||||
|
||||
export const archiveTodosAtTurnEnd = () => {
|
||||
const state = $turnState.get()
|
||||
|
||||
if (!isTodoDone(state.todos)) {
|
||||
if (!state.todos.length) {
|
||||
return []
|
||||
}
|
||||
|
||||
const msg: Msg = { kind: 'trail', role: 'system', text: '', todos: state.todos }
|
||||
const msg: Msg = {
|
||||
kind: 'trail',
|
||||
role: 'system',
|
||||
text: '',
|
||||
todos: state.todos,
|
||||
...(isTodoDone(state.todos) ? {} : { todoIncomplete: true })
|
||||
}
|
||||
|
||||
patchTurnState({ todoCollapsed: false, todos: [] })
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue