mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-05 02:31:47 +00:00
feat: refactor by splitting up app and doing proper state
This commit is contained in:
parent
4cbf54fb33
commit
99d859ce4a
27 changed files with 4087 additions and 2939 deletions
|
|
@ -74,9 +74,17 @@ export const pasteTokenLabel = (text: string, lineCount: number) => {
|
|||
}
|
||||
|
||||
export const thinkingPreview = (reasoning: string, mode: ThinkingMode, max: number) => {
|
||||
const text = reasoning.replace(/\n/g, ' ').trim()
|
||||
const raw = reasoning.trim()
|
||||
|
||||
return !text || mode === 'collapsed' ? '' : mode === 'full' ? text : compactPreview(text, max)
|
||||
if (!raw || mode === 'collapsed') {
|
||||
return ''
|
||||
}
|
||||
|
||||
if (mode === 'full') {
|
||||
return raw
|
||||
}
|
||||
|
||||
return compactPreview(raw.replace(/\s+/g, ' '), max)
|
||||
}
|
||||
|
||||
export const stripTrailingPasteNewlines = (text: string) => (/[^\n]/.test(text) ? text.replace(/\n+$/, '') : text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue