Module: Aidp::Interfaces::UiInterface
Overview
UiInterface defines the contract for user interface operations. This interface abstracts TTY-based UI components for extraction into the agent-harness gem, allowing different UI implementations.
The interface covers two main areas:
- Message display - showing status messages to users
- Spinner/progress - showing activity indicators
Constant Summary collapse
- MESSAGE_TYPES =
Message types for display_message
[:info, :success, :warning, :error, :highlight, :muted].freeze
Instance Method Summary collapse
-
#quiet? ⇒ Boolean
Check if we're in quiet mode (suppress non-critical messages).
-
#say(message, type: :info) ⇒ void
Display a message to the user.
-
#spinner(title:) ⇒ SpinnerInterface
Create a spinner for manual control.
-
#with_spinner(title:) { ... } ⇒ Object
Execute a block with a spinner indicator.
Instance Method Details
#quiet? ⇒ Boolean
Check if we're in quiet mode (suppress non-critical messages).
77 78 79 |
# File 'lib/aidp/interfaces/ui_interface.rb', line 77 def quiet? false end |
#say(message, type: :info) ⇒ void
This method returns an undefined value.
Display a message to the user.
52 53 54 |
# File 'lib/aidp/interfaces/ui_interface.rb', line 52 def say(, type: :info) raise NotImplementedError, "#{self.class} must implement #say" end |
#spinner(title:) ⇒ SpinnerInterface
Create a spinner for manual control. Returns an object that responds to :auto_spin, :success, :error, and :update_title
70 71 72 |
# File 'lib/aidp/interfaces/ui_interface.rb', line 70 def spinner(title:) raise NotImplementedError, "#{self.class} must implement #spinner" end |
#with_spinner(title:) { ... } ⇒ Object
Execute a block with a spinner indicator.
61 62 63 |
# File 'lib/aidp/interfaces/ui_interface.rb', line 61 def with_spinner(title:) raise NotImplementedError, "#{self.class} must implement #with_spinner" end |