Class: RailsConsoleAi::Channel::SubAgent
- Defined in:
- lib/rails_console_ai/channel/sub_agent.rb
Instance Method Summary collapse
- #cancelled? ⇒ Boolean
- #confirm(text) ⇒ Object
- #display(text) ⇒ Object
- #display_code(code) ⇒ Object
- #display_error(text) ⇒ Object
- #display_result(result) ⇒ Object
- #display_result_output(output) ⇒ Object
- #display_status(text) ⇒ Object
- #display_thinking(text) ⇒ Object
- #display_tool_call(text) ⇒ Object
- #display_warning(text) ⇒ Object
-
#initialize(parent_channel:, task_label: nil) ⇒ SubAgent
constructor
A new instance of SubAgent.
- #mode ⇒ Object
- #prompt(text) ⇒ Object
- #supports_danger? ⇒ Boolean
- #supports_editing? ⇒ Boolean
- #system_instructions ⇒ Object
- #user_identity ⇒ Object
- #wrap_llm_call(&block) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(parent_channel:, task_label: nil) ⇒ SubAgent
Returns a new instance of SubAgent.
6 7 8 9 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 6 def initialize(parent_channel:, task_label: nil) @parent = parent_channel @label = task_label end |
Instance Method Details
#cancelled? ⇒ Boolean
63 64 65 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 63 def cancelled? @parent.cancelled? end |
#confirm(text) ⇒ Object
51 52 53 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 51 def confirm(text) 'y' end |
#display(text) ⇒ Object
11 12 13 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 11 def display(text) # Swallowed — sub-agent final text is returned as tool result, not displayed end |
#display_code(code) ⇒ Object
35 36 37 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 35 def display_code(code) # Swallowed — sub-agent auto-executes, no need to show code end |
#display_error(text) ⇒ Object
27 28 29 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 27 def display_error(text) @parent.display_error(text) end |
#display_result(result) ⇒ Object
43 44 45 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 43 def display_result(result) # Swallowed — sub-agent return values aren't useful to show end |
#display_result_output(output) ⇒ Object
39 40 41 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 39 def display_result_output(output) @parent.display_result_output(output) end |
#display_status(text) ⇒ Object
19 20 21 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 19 def display_status(text) @parent.display_status(text) end |
#display_thinking(text) ⇒ Object
15 16 17 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 15 def display_thinking(text) @parent.display_thinking(text) end |
#display_tool_call(text) ⇒ Object
31 32 33 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 31 def display_tool_call(text) @parent.display_tool_call(text) end |
#display_warning(text) ⇒ Object
23 24 25 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 23 def display_warning(text) @parent.display_warning(text) end |
#mode ⇒ Object
59 60 61 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 59 def mode 'sub_agent' end |
#prompt(text) ⇒ Object
47 48 49 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 47 def prompt(text) '(sub-agent cannot ask user)' end |
#supports_danger? ⇒ Boolean
67 68 69 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 67 def supports_danger? false # Sub-agents must never silently bypass safety guards end |
#supports_editing? ⇒ Boolean
71 72 73 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 71 def supports_editing? false end |
#system_instructions ⇒ Object
79 80 81 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 79 def system_instructions nil end |
#user_identity ⇒ Object
55 56 57 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 55 def user_identity @parent.user_identity end |
#wrap_llm_call(&block) ⇒ Object
75 76 77 |
# File 'lib/rails_console_ai/channel/sub_agent.rb', line 75 def wrap_llm_call(&block) yield end |