Skip to main content

Module widgets

Module widgets 

Source
Expand description

Plugin widget notification types and parser.

Phase B Phase 3 contract — see docs/plans/2026-05-03-extension-contracts-for-rich-plugins.md.

Plugins push spontaneous JSON-RPC notifications to create, update, or dismiss persistent on-screen widgets (HUD panels, status boxes, etc.) outside the slash-command request/response cycle. Method names: widget.upsert, widget.dismiss.

Wire shapes (params per method):

  • widget.upsert: { id, lines: string[], position?: string, title?: string, ttl_secs?: number | null }
  • widget.dismiss: { id }

Valid position values: "top_left", "top_center", "top_right", "middle_left", "center", "middle_right", "bottom_left", "bottom_center", "bottom_right". Defaults to "top_right".

ttl_secs: None means the widget is persistent (no auto-dismiss). ttl_secs: Some(n) means the widget auto-dismisses after n seconds.

Structs§

ExtensionWidgetEvent
Event sent from a background notification watcher to the TUI. Carries the source extension id and the parsed widget event.
StyledSpan
A single styled text span sent over the wire from an extension. Extensions specify colors as CSS-style hex strings (e.g. "#ff0000").

Enums§

WidgetEvent
Parsed widget notification.

Functions§

is_widget_method
Returns true if method is one of the recognised widget notifications.
parse_widget_event
Parse a widget.* notification given the JSON-RPC method and params.