hermes-agent/apps/desktop/src
Teknium f525772725
fix(desktop): keep config/structured code blocks fenced instead of unwrapping to prose (#84664)
* fix(desktop): keep config/structured code blocks fenced instead of unwrapping to prose

The desktop markdown preprocessor has a "prose fence" heuristic that
strips the fence off blocks it thinks are wrapped prose. Its
`proseLines >= 3 && codeSignals === 0` rule fires on ANY 3+ line
plaintext block with no JS/SQL tokens -- which is exactly what an SSH
config, a .env dump, or any INI/key-value listing looks like. The result
was that a fenced ```-block of SSH config rendered as a flat paragraph
instead of a code block.

Add isLikelyStructuredText() and use it as a veto in both
isLikelyProseFence() and isLikelyProseCodeBlock(): a block is treated as
structured (and kept fenced) when it has indented continuation lines, or
when it has no sentence-ending punctuation and a majority of lines are
`Key value` / `Key: value` directives. Real wrapped prose has
sentence-shaped lines and no per-line indentation, so it still unwraps as
before. The bullet-prose case in isLikelyProseCodeBlock is checked first
so markdown bullet lists remain prose.

Tests: markdown-code.test.ts gains SSH-config / flat-config / .env
regression cases for both functions, plus direct isLikelyStructuredText
coverage, and re-asserts that genuine paragraph prose still unwraps.

* fix(desktop): tighten config-line detection to not match punctuation-less prose

The first CONFIG_LINE_RE matched any 'word word' line, so a wrapped prose
fragment with no sentence punctuation (e.g. 'the quick brown fox jumps')
was misread as a config directive and its fence kept. Split into an
explicit-separator form (Key: value / Key = value) plus a short 2-3 token
'Key value' directive form; a real sentence line has more tokens, so
punctuation-less prose is no longer treated as config.
2026-08-12 11:08:55 -07:00
..
app perf(desktop): long streaming agent sessions — steady window cut, stable rows, stepped backfill, pane-shared budget (#83446) 2026-08-10 21:06:59 +00:00
assets/tiers
…
components fix(desktop): collapse Fireworks behind the provider disclosure on first run 2026-08-10 21:09:27 -07:00
contrib fmt(js): `npm run fix` on merge (#83409) 2026-08-10 19:40:25 +00:00
debug
…
fonts
…
hooks
…
i18n fix(desktop): list HUD snap chord in keyboard shortcuts panel 2026-08-10 05:21:07 -05:00
lib fix(desktop): keep config/structured code blocks fenced instead of unwrapping to prose (#84664) 2026-08-12 11:08:55 -07:00
plugins
…
sdk
…
store fmt(js): `npm run fix` on merge (#83139) 2026-08-10 10:55:40 +00:00
themes
…
types fmt(js): `npm run fix` on merge (#82962) 2026-08-10 05:40:43 +00:00
global.d.ts fix(desktop): persist renderer crashes to desktop.log + finish the render() isolation class 2026-08-10 17:10:53 -07:00
hermes-cron-scope.test.ts
…
hermes-parity.test.ts
…
hermes-profile-scope.test.ts
…
hermes.test.ts
…
hermes.ts fix(desktop): scope custom provider settings to the active profile 2026-08-10 22:26:54 -05:00
main.tsx fix(desktop): title HUD windows Hermes HUD 2026-08-10 16:19:50 -05:00
pairing-scope.test.ts
…
styles.css Merge pull request #83115 from NousResearch/bb/browser-pane-resize 2026-08-10 05:07:01 -05:00
vite-env.d.ts
…
webhooks-rest.test.ts
…