Class: Clacky::RichAgentShell

Inherits:
RubyRich::AgentShell
  • Object
show all
Defined in:
lib/clacky/rich_ui/shell/rich_agent_shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#callbacksObject (readonly)

Returns the value of attribute callbacks.



12
13
14
# File 'lib/clacky/rich_ui/shell/rich_agent_shell.rb', line 12

def callbacks
  @callbacks
end

#clacky_controllerObject

Returns the value of attribute clacky_controller.



11
12
13
# File 'lib/clacky/rich_ui/shell/rich_agent_shell.rb', line 11

def clacky_controller
  @clacky_controller
end

Returns the value of attribute sidebar.



10
11
12
# File 'lib/clacky/rich_ui/shell/rich_agent_shell.rb', line 10

def sidebar
  @sidebar
end

#thinking_liveObject (readonly)

Returns the value of attribute thinking_live.



10
11
12
# File 'lib/clacky/rich_ui/shell/rich_agent_shell.rb', line 10

def thinking_live
  @thinking_live
end

Instance Method Details

#on_esc(&block) ⇒ Object



173
174
175
176
# File 'lib/clacky/rich_ui/shell/rich_agent_shell.rb', line 173

def on_esc(&block)
  @callbacks[:esc] = block
  self
end

#toggle_permission_modeObject



163
164
165
166
167
168
169
170
171
# File 'lib/clacky/rich_ui/shell/rich_agent_shell.rb', line 163

def toggle_permission_mode
  current = @callbacks[:mode_toggle] ? @mode : :confirm_safes
  # Toggle between confirm_safes and confirm_all
  new_mode = current.to_s == "confirm_all" ? "confirm_safes" : "confirm_all"
  @mode = new_mode.to_sym
  @callbacks[:mode_toggle]&.call(@mode)
  @status = "mode ยท #{@mode}"
  @focus_manager.focus(:composer)
end