mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-27 01:11:40 +00:00
feat: better markdown
This commit is contained in:
parent
9ccb490cf3
commit
24a498eb90
3 changed files with 407 additions and 74 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { fmtK, isToolTrailResultLine, lastCotTrailIndex, sameToolTrailGroup } from '../lib/text.js'
|
||||
import { estimateRows, fmtK, isToolTrailResultLine, lastCotTrailIndex, sameToolTrailGroup } from '../lib/text.js'
|
||||
|
||||
describe('isToolTrailResultLine', () => {
|
||||
it('detects completion markers', () => {
|
||||
|
|
@ -49,3 +49,17 @@ describe('fmtK', () => {
|
|||
expect(fmtK(1_000_000_000)).toBe('1B')
|
||||
})
|
||||
})
|
||||
|
||||
describe('estimateRows', () => {
|
||||
it('handles tilde code fences', () => {
|
||||
const md = ['~~~markdown', '# heading', '~~~'].join('\n')
|
||||
|
||||
expect(estimateRows(md, 40)).toBeGreaterThanOrEqual(2)
|
||||
})
|
||||
|
||||
it('handles checklist bullets as list rows', () => {
|
||||
const md = ['- [x] done', '- [ ] todo'].join('\n')
|
||||
|
||||
expect(estimateRows(md, 40)).toBe(2)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue