Expand description
Tier-2 IPC helpers — write JSONL commands to the host.
Siblings spawned by mnml as Pty children (or Mount siblings)
get MNML_IPC_DIR in env. The host tails
$MNML_IPC_DIR/command for JSONL lines and dispatches each
one into App::dispatch_command. This module wraps the wire
format so siblings write typed helper calls instead of
hand-rolling JSON.
Every helper is best-effort: silent no-op on missing env, silent no-op on IO error. Siblings should treat these as fire-and-forget notifications, not as commands they need to confirm succeeded.
mnml_bridge::toast("processing done");
mnml_bridge::set_activity_badge("agents", 3);
mnml_bridge::register_command(
"my_sibling.open_dashboard",
"Open Dashboard",
Some("plugin"),
&["<leader>md"],
);Structs§
- Notify
Opts - Options for
notify. All fields are optional-ish — see individual field docs.
Enums§
- Progress
Status - Outcome of a progress notification.
- Segment
Side - Statusline segment anchor.
- Toast
Level - Toast severity level. Info + warn share the standard comment border (calm ambient); error gets a red border so failures stand out. Persistent toasts respect the same mapping.
Functions§
- notify
- Fire an OS-level notification. Host emits OSC 9 + 777 escape sequences after the next render pass — Ghostty / iTerm2 / kitty / WezTerm route those to native banners. Terminals that don’t recognize the escape silently consume it.
- progress_
end - Finish a progress notification.
Failedalso fires atoast_errorhost-side;Success/Cancelledshow the terminal status glyph and fade after ~2.5s. - progress_
start - Start a progress notification — the host renders an animated Braille spinner + label. Repeat calls with the same id reset the item.
- progress_
update - Update an in-flight progress.
labelandpercentare both optional — passNoneto keep the previous value. Percent clamps to 0..=100 host-side. - register_
command - Register a plugin command. It becomes runnable from the
palette + optionally bound to one or more key chords in the
host. Keyspec syntax mirrors mnml’s own keymap
(
"ctrl+shift+t","<leader>xt", …). - set_
activity_ badge - Set a notification badge on an activity-bar section (or a
manifest-registered Mount section, keyed by its manifest id).
count = 0clears the badge. - statusline_
clear_ segment - Remove a sibling statusline segment by id.
- statusline_
set_ segment - Insert or update a sibling statusline segment. Sorted host-side by priority desc; each segment competes for its lane’s budget.
- toast
- Show a toast notification in the host. Non-blocking,
fire-and-forget. Silent no-op when
MNML_IPC_DIRis unset (sibling wasn’t spawned by mnml) or on any IO error. - toast_
dismiss - Remove a persistent toast by id. No-op if the id isn’t currently pinned.
- toast_
error - toast_
info - Level-tagged toast helpers — same wire shape as
toastbut with an explicitlevelfield.info(default) +warnrender with the comment border;errorgets a red border. - toast_
persistent - Pin a toast identified by
id. Repeat calls with the same id update the text/level in place. Stays visible untiltoast_dismiss. - toast_
warn