Skip to main content

NoUi

Struct NoUi 

Source
pub struct NoUi;
Expand description

The UI of print and JSON modes: nothing is shown.

Trait Implementations§

Source§

impl ExtensionUi for NoUi

Source§

fn has_ui(&self) -> bool

Whether a person can answer dialogs.
Source§

fn notify(&self, _message: &str, _kind: NotifyKind)

Shows a message.
Source§

fn shutdown(&self)

pi’s ctx.shutdown(): the mode exits once the agent is idle.
Source§

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>>

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>>

Asks for a line of text, resolving to None when cancelled.
Source§

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>>

Asks for multi-line text starting from prefill, resolving to None when cancelled.
Source§

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>, )

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>)

Replaces the startup header, or restores the built-in one.
Source§

fn set_title(&self, _title: &str)

Sets the terminal title.
Source§

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>)

Sets the message shown while the agent works, or restores the default.
Source§

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>)

Sets the animation shown while the agent works, or restores the default spinner.
Source§

fn set_hidden_thinking_label(&self, _label: Option<&str>)

Sets the label of hidden thinking blocks, or restores the default.
Source§

fn set_editor_text(&self, _text: &str)

Replaces the editor’s text.
Source§

fn paste_to_editor(&self, text: &str)

Pastes into the editor as a terminal paste would.
Source§

fn editor_text(&self) -> String

The editor’s text.
Source§

fn shows_components(&self) -> bool

Whether ExtensionUi::custom and component widgets are shown.
Source§

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)

The extension’s editor now holds text, paste markers expanded.
Source§

fn editor_submit(&self, _text: &str)

The extension’s editor submitted text.
Source§

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>>, )

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>, )

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>

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

The built-in provider’s applyCompletion for {"lines", "cursorLine", "cursorCol", "item", "prefix"}: {"lines", "cursorLine", "cursorCol"}.
Source§

fn editor_shortcut(&self, _data: &str) -> bool

Whether raw input data is an extension shortcut, which then runs.
Source§

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)

Shows component with keyboard focus until ExtensionUi::close.
Source§

fn close(&self, _component: RemoteComponent)

Removes the custom component component.
Source§

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)

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)

Components changed and need rendering.
Source§

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

Whether tool output is expanded.
Source§

fn set_tools_expanded(&self, _expanded: bool)

Expands or collapses tool output.
Source§

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.
Source§

fn footer_data(&self) -> Value

What custom footers read: {"gitBranch", "statuses": [[key, text]], "providers"}.
Source§

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 get_theme(&self, _name: &str) -> Value

The theme called name, as ExtensionUi::theme describes it, or Null when there is none.
Source§

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.
Source§

fn set_theme(&self, _theme: &Value) -> Result<(), String>

Switches to theme: a theme name, which is saved as /settings saves it, or a theme document {"name", "appearance", "colors"}, which is not saved. The error says why it could not.
Source§

fn extension_error( &self, path: &str, _event: &str, error: &str, _stack: Option<&str>, )

A handler of extension path failed on event, with the error’s stack when the runtime gave one. By default it reports as print mode does.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more