pub struct NoUi;Expand description
The UI of print and JSON modes: nothing is shown.
Trait Implementations§
Source§impl ExtensionUi for NoUi
impl ExtensionUi for NoUi
Source§fn notify(&self, _message: &str, _kind: NotifyKind)
fn notify(&self, _message: &str, _kind: NotifyKind)
Shows a message.
Source§fn notify_untyped(&self, message: &str)
fn notify_untyped(&self, message: &str)
Shows a message that names no kind. Hosts show it as information,
and RPC forwards it without a kind, as pi does.
Source§fn select(
&self,
_title: &str,
_options: Vec<String>,
_dialog: DialogOptions,
) -> BoxFuture<'static, Option<String>>
fn select( &self, _title: &str, _options: Vec<String>, _dialog: DialogOptions, ) -> BoxFuture<'static, Option<String>>
Asks to pick one of
options, resolving to None when cancelled.Source§fn input(
&self,
_title: &str,
_placeholder: Option<&str>,
_dialog: DialogOptions,
) -> BoxFuture<'static, Option<String>>
fn input( &self, _title: &str, _placeholder: Option<&str>, _dialog: DialogOptions, ) -> BoxFuture<'static, Option<String>>
Asks for a line of text, resolving to
None when cancelled.Source§fn confirm(
&self,
_title: &str,
_message: &str,
_dialog: DialogOptions,
) -> BoxFuture<'static, bool>
fn confirm( &self, _title: &str, _message: &str, _dialog: DialogOptions, ) -> BoxFuture<'static, bool>
Asks a yes or no question, resolving to
false when cancelled.Source§fn editor(
&self,
_title: &str,
_prefill: Option<&str>,
) -> BoxFuture<'static, Option<String>>
fn editor( &self, _title: &str, _prefill: Option<&str>, ) -> BoxFuture<'static, Option<String>>
Asks for multi-line text starting from
prefill, resolving to None
when cancelled.Source§fn set_status(&self, _key: &str, _text: Option<&str>)
fn set_status(&self, _key: &str, _text: Option<&str>)
Sets the footer status
key, or clears it.Source§fn set_widget(
&self,
_key: &str,
_widget: Option<Widget>,
_placement: Option<Placement>,
)
fn set_widget( &self, _key: &str, _widget: Option<Widget>, _placement: Option<Placement>, )
Sets widget
key, or removes it. Without a placement it goes above
the editor.Replaces the footer, or restores the built-in one.
Source§fn set_header(&self, _component: Option<RemoteComponent>)
fn set_header(&self, _component: Option<RemoteComponent>)
Replaces the startup header, or restores the built-in one.
Source§fn refresh_completions(&self)
fn refresh_completions(&self)
Completions an extension computed in the background are ready. The
editor asks for its suggestions again.
Source§fn set_working_message(&self, _message: Option<&str>)
fn set_working_message(&self, _message: Option<&str>)
Sets the message shown while the agent works, or restores the default.
Source§fn set_working_visible(&self, _visible: bool)
fn set_working_visible(&self, _visible: bool)
Shows or hides the indicator shown while the agent works.
Source§fn set_working_indicator(&self, _indicator: Option<WorkingIndicator>)
fn set_working_indicator(&self, _indicator: Option<WorkingIndicator>)
Sets the animation shown while the agent works, or restores the
default spinner.
Sets the label of hidden thinking blocks, or restores the default.
Source§fn set_editor_text(&self, _text: &str)
fn set_editor_text(&self, _text: &str)
Replaces the editor’s text.
Source§fn paste_to_editor(&self, text: &str)
fn paste_to_editor(&self, text: &str)
Pastes into the editor as a terminal paste would.
Source§fn editor_text(&self) -> String
fn editor_text(&self) -> String
The editor’s text.
Source§fn shows_components(&self) -> bool
fn shows_components(&self) -> bool
Whether
ExtensionUi::custom and component widgets are shown.Source§fn set_editor(&self, _editor: Option<RemoteComponent>, _embeds_status: bool)
fn set_editor(&self, _editor: Option<RemoteComponent>, _embeds_status: bool)
Replaces the editor with
editor, or restores the built-in one.
embeds_status when the editor shows the working status in its top
border.Source§fn editor_changed(&self, _text: &str)
fn editor_changed(&self, _text: &str)
The extension’s editor now holds
text, paste markers expanded.Source§fn editor_submit(&self, _text: &str)
fn editor_submit(&self, _text: &str)
The extension’s editor submitted
text.Source§fn editor_action(&self, _action: &str)
fn editor_action(&self, _action: &str)
The extension’s editor asks for app action
action, a key binding id
such as app.interrupt.Source§fn set_terminal_input(
&self,
_runtime: u64,
_listeners: Option<Arc<dyn ComponentHost>>,
)
fn set_terminal_input( &self, _runtime: u64, _listeners: Option<Arc<dyn ComponentHost>>, )
Starts passing raw input through the
onTerminalInput listeners of
extension runtime runtime, which listeners runs, or stops with
None. Runtimes’ listeners see input in the order they started.Source§fn set_autocomplete(
&self,
_providers: Arc<dyn ComponentHost>,
_triggers: Vec<String>,
)
fn set_autocomplete( &self, _providers: Arc<dyn ComponentHost>, _triggers: Vec<String>, )
Completes through the providers composed with
addAutocompleteProvider, which providers runs. triggers open
completion too. They replace the providers of the runtime that set
them before.Source§fn suggestions(&self, _request: Value) -> BoxFuture<'static, Value>
fn suggestions(&self, _request: Value) -> BoxFuture<'static, Value>
What the built-in provider suggests for pi’s provider arguments
request, {"lines", "cursorLine", "cursorCol", "force"} with
UTF-16 columns: pi’s AutocompleteSuggestions, or Null.Source§fn apply_completion(&self, _request: &Value) -> Value
fn apply_completion(&self, _request: &Value) -> Value
The built-in provider’s
applyCompletion for {"lines", "cursorLine", "cursorCol", "item", "prefix"}: {"lines", "cursorLine", "cursorCol"}.Source§fn editor_shortcut(&self, _data: &str) -> bool
fn editor_shortcut(&self, _data: &str) -> bool
Whether raw input
data is an extension shortcut, which then runs.Source§fn keybindings(&self) -> Value
fn keybindings(&self) -> Value
The key bindings components match keys against:
{"kitty", "bindings": {id: [key]}, "actions": [id]}, where actions are the
app actions an extension’s editor can ask for. Null keeps pi-tui’s
defaults.Source§fn custom(&self, _component: RemoteComponent, _options: CustomOptions)
fn custom(&self, _component: RemoteComponent, _options: CustomOptions)
Shows
component with keyboard focus until ExtensionUi::close.Source§fn close(&self, _component: RemoteComponent)
fn close(&self, _component: RemoteComponent)
Removes the custom component
component.Source§fn drop_components(&self, _runtime: u64)
fn drop_components(&self, _runtime: u64)
Removes the editor, widgets, footer and header that extension runtime
runtime showed, which it lost when it restarted. The built-in
editor, footer and header return.Source§fn mcp_manager(&self, _screen: McpScreen)
fn mcp_manager(&self, _screen: McpScreen)
Shows a screen of the
/mcp manager with keyboard focus, opening the
manager. McpScreen::Close closes it. Without the TUI the screen
is dropped, which closes its menu.Source§fn request_render(&self)
fn request_render(&self)
Components changed and need rendering.
Source§fn renderers_changed(&self)
fn renderers_changed(&self)
An extension registered transcript renderers or a Markdown
transformer after its session started. What draws next uses them.
Source§fn tools_expanded(&self) -> bool
fn tools_expanded(&self) -> bool
Whether tool output is expanded.
Source§fn set_tools_expanded(&self, _expanded: bool)
fn set_tools_expanded(&self, _expanded: bool)
Expands or collapses tool output.
Source§fn terminal(&self) -> Option<Receiver<TerminalState>>
fn terminal(&self) -> Option<Receiver<TerminalState>>
The terminal’s state, kept current as it changes, or
None without a
terminal, as in print, JSON and RPC modes.What custom footers read:
{"gitBranch", "statuses": [[key, text]], "providers"}.Source§fn theme(&self) -> Value
fn theme(&self) -> Value
The theme as escape sequences, and the colors they come from:
{"name", "mode", "fg": {token: sequence}, "bg": {token: sequence}, "dim": [token], "colors": {token: color}}. Null leaves text
unstyled.Source§fn all_themes(&self) -> Value
fn all_themes(&self) -> Value
pi’s
getAllThemes: the themes ExtensionUi::set_theme can switch
to, as [{"name", "path"}] with no path for a theme without a file.
Empty without a UI that switches themes, as in pi’s RPC mode.Auto Trait Implementations§
impl Freeze for NoUi
impl RefUnwindSafe for NoUi
impl Send for NoUi
impl Sync for NoUi
impl Unpin for NoUi
impl UnsafeUnpin for NoUi
impl UnwindSafe for NoUi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more