mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-17 02:05:57 +00:00
The OpenTUI engine vendored 10 tree-sitter grammars (.wasm + .scm) under
ui-opentui/parsers/ — ~37k checked-in binary lines, the single biggest
addition in the engine diff. opencode (the production reference) vendors
none: it declares grammars as remote URLs and lets OpenTUI fetch + cache
them. OpenTUI supports this natively via TreeSitterClient's dataPath cache.
Migrate to that model:
- parsers.manifest.json (now under src/boundary/) becomes the URL source of
truth: each grammar is { filetype, aliases, wasm: <release URL>,
highlights: <.scm URL> }. Grammar versions stay pinned (same release tags);
.scm sources follow opencode's per-language choices (parser-repo queries
for python/html where nvim-treesitter's are parser-incompatible).
- parsers.ts: registerVendoredParsers -> registerRemoteParsers. It points the
global tree-sitter client's cache at HERMES_TUI_PARSER_CACHE via setDataPath
BEFORE the client initializes, then addDefaultParsers() with the URL configs.
Registration does zero network; the fetch is lazy on first use of a language
and degrades to plain text (never throws) when GitHub is unreachable.
- hermes_cli/main.py sets HERMES_TUI_PARSER_CACHE to
~/.hermes/cache/opentui-parsers/ (profile-aware via get_hermes_home).
- git rm -r ui-opentui/parsers/ and drop scripts/update-parsers.mjs.
- parsers.test.tsx asserts URL configs are well-formed + cache-dir behavior
instead of vendored-file existence.
Verified end-to-end on Node 26.3: type-check + lint clean, full ui-opentui
suite (821 tests) green, and a built smoke proves first-use fetch -> cache ->
10 real highlights, cache-hit on rerun, and graceful plain-text degrade when
the grammar URLs are unreachable.
|
||
|---|---|---|
| .. | ||
| design | ||
| kanban | ||
| middleware | ||
| observability | ||
| plans | ||
| security | ||
| hermes-kanban-v1-spec.pdf | ||
| ink-env-flags.md | ||
| opentui-dev-handoff.md | ||
| opentui-env-flags.md | ||
| opentui-memory-story.md | ||
| opentui-native-engine.md | ||
| opentui-upstream-alignment.md | ||
| rca-ssl-cacert-post-git-pull.md | ||