Files
hermes-agent/website/docs/developer-guide
Teknium 814f507f45 feat(desktop): app-owned composer context-menu slot + host.spellcheck
Plugins could only add rows to the composer's right-click menu by
injecting DOM into it and could only teach Chromium a word through the
raw window.hermesDesktop bridge (held catalog plugin #143059). The app
now owns both seams:

- COMPOSER_AREAS.contextMenu: a data contribution (`items(context)`)
  consulted only when the right-click lands in a composer. A provider
  sees two strings (word under the caret, composer selection), never an
  element or Range. The app renders rows with its own menu item, one
  section per plugin ordered by source id (code-point), capped at six
  rows per plugin, isolates throwing/garbage providers, runs the row
  after the menu closed, and drops a plugin's rows on unload (including
  from an open menu). The only edit offered is `replaceWord(text)`:
  replaces exactly the right-clicked word through Chromium's editing
  command, refuses once that word is no longer there, and banks the
  composer's own undo point so the swap is undoable.
- host.spellcheck.addWord/removeWord: one IPC channel the app owns
  (hermes:spellcheck:dictionary) that accepts one bounded word (letters,
  marks, digits, inner '/-; <= 64 chars) and calls the sender session's
  add/removeWordToSpellCheckerDictionary. No list/read API. The existing
  context-menu spell-check handlers move into the same module so main.ts
  shrinks.

The composer word-at-caret probe adapts the one in #143054.

Co-authored-by: thileman <44035903+thileman@users.noreply.github.com>
2026-10-23 11:54:52 -07:00
..