feat: add ctx.ui.setWorkingMessage() extension API

Allows extensions to customize the streaming loader message.
Pass undefined to restore default.
This commit is contained in:
Nico Bailon 2026-01-10 21:02:41 -08:00
parent 016a24e9a1
commit 271b49da3c
6 changed files with 24 additions and 1 deletions

View file

@ -1170,6 +1170,7 @@ Extensions can interact with users via `ctx.ui` methods and customize how messag
- Async operations with cancel (BorderedLoader)
- Settings toggles (SettingsList)
- Status indicators (setStatus)
- Working message during streaming (setWorkingMessage)
- Widgets above editor (setWidget)
- Custom footers (setFooter)
@ -1256,6 +1257,10 @@ See [examples/extensions/timed-confirm.ts](../examples/extensions/timed-confirm.
ctx.ui.setStatus("my-ext", "Processing...");
ctx.ui.setStatus("my-ext", undefined); // Clear
// Working message (shown during streaming)
ctx.ui.setWorkingMessage("Thinking deeply...");
ctx.ui.setWorkingMessage(); // Restore default
// Widget above editor (string array or factory function)
ctx.ui.setWidget("my-widget", ["Line 1", "Line 2"]);
ctx.ui.setWidget("my-widget", (tui, theme) => new Text(theme.fg("accent", "Custom"), 0, 0));