Expand description
Plugin custom-editor JSON-RPC payloads (Path B Phase 4).
When a user opens a plugin-declared settings field whose editor is
"custom", Synaps and the plugin exchange these typed messages over
the existing JSON-RPC channel:
synaps → plugin settings.editor.open { category, field }
plugin → synaps settings.editor.render { rows, cursor?, footer? } (notification, repeated)
synaps → plugin settings.editor.key { key } (per keypress)
plugin → synaps settings.editor.commit { value } (when user accepts)The render notification is a server-push that may be emitted multiple times as the plugin’s editor state evolves; consumers should debounce at the UI layer to avoid flicker.
Wire shape mirrors extensions::commands::CommandOutputEvent. This
module owns only the typed contracts and a small parser; the
settings UI glue (overlay rendering, key dispatch, debounce) lives in
chatui/settings/.
Structs§
- Settings
Editor Close Params settings.editor.close— either side may emit this to dismiss the overlay (e.g. plugin-side cancellation).- Settings
Editor Commit Params settings.editor.commit— plugin → synaps notification when the user accepts a value. Synaps writesvalueto the plugin’s config namespace at(category, field)and closes the overlay.- Settings
Editor KeyParams settings.editor.key— synaps → plugin notification on each keypress while a custom editor is focused.keyis the string form produced bycrossterm::event::KeyEvent(e.g."Down","Enter","Esc","Char(' ')"— the exact lexicon is documented alongside the keybind subsystem).- Settings
Editor Open Params settings.editor.open— synaps → plugin request when the user opens a custom editor for(category, field).- Settings
Editor Render Params settings.editor.render— plugin → synaps notification carrying the current visual state of the editor body.- Settings
Editor Row - A single row in the custom editor body.
Enums§
- Inbound
Settings Editor Frame - Normalised view of a single inbound frame. Distinguishes the four
notifications the core can receive from the plugin side. (The
open/keyrequests originate from the core and are typed via the individual params structs above.) - Settings
Editor Parse Error - Errors returned when parsing a JSON-RPC frame whose method belongs
to the
settings.editor.*family but whose params don’t match the expected shape.
Constants§
Functions§
- parse_
inbound - Parse the params object of a
settings.editor.*notification.