Class: RubynCode::CLI::Commands::Context
- Inherits:
-
Data
- Object
- Data
- RubynCode::CLI::Commands::Context
- Defined in:
- lib/rubyn_code/cli/commands/context.rb
Overview
Immutable context object passed to every slash command. Provides access to all REPL dependencies without coupling commands to the REPL class itself.
Instance Attribute Summary collapse
-
#agent_loop ⇒ Object
readonly
Returns the value of attribute agent_loop.
-
#background_worker ⇒ Object
readonly
Returns the value of attribute background_worker.
-
#budget_enforcer ⇒ Object
readonly
Returns the value of attribute budget_enforcer.
-
#context_manager ⇒ Object
readonly
Returns the value of attribute context_manager.
-
#conversation ⇒ Object
readonly
Returns the value of attribute conversation.
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#llm_client ⇒ Object
readonly
Returns the value of attribute llm_client.
-
#message_handler ⇒ Object
readonly
Returns the value of attribute message_handler.
-
#permission_tier ⇒ Object
readonly
Returns the value of attribute permission_tier.
-
#plan_mode ⇒ Object
readonly
Returns the value of attribute plan_mode.
-
#project_root ⇒ Object
readonly
Returns the value of attribute project_root.
-
#renderer ⇒ Object
readonly
Returns the value of attribute renderer.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
-
#session_persistence ⇒ Object
readonly
Returns the value of attribute session_persistence.
-
#skill_loader ⇒ Object
readonly
Returns the value of attribute skill_loader.
Instance Method Summary collapse
- #plan_mode? ⇒ Boolean
- #send_message(text) ⇒ Object
-
#with_message_handler(handler) ⇒ Object
Convenience: return a new Context with a message handler attached.
Instance Attribute Details
#agent_loop ⇒ Object (readonly)
Returns the value of attribute agent_loop
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def agent_loop @agent_loop end |
#background_worker ⇒ Object (readonly)
Returns the value of attribute background_worker
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def background_worker @background_worker end |
#budget_enforcer ⇒ Object (readonly)
Returns the value of attribute budget_enforcer
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def budget_enforcer @budget_enforcer end |
#context_manager ⇒ Object (readonly)
Returns the value of attribute context_manager
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def context_manager @context_manager end |
#conversation ⇒ Object (readonly)
Returns the value of attribute conversation
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def conversation @conversation end |
#db ⇒ Object (readonly)
Returns the value of attribute db
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def db @db end |
#llm_client ⇒ Object (readonly)
Returns the value of attribute llm_client
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def llm_client @llm_client end |
#message_handler ⇒ Object (readonly)
Returns the value of attribute message_handler
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def @message_handler end |
#permission_tier ⇒ Object (readonly)
Returns the value of attribute permission_tier
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def @permission_tier end |
#plan_mode ⇒ Object (readonly)
Returns the value of attribute plan_mode
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def plan_mode @plan_mode end |
#project_root ⇒ Object (readonly)
Returns the value of attribute project_root
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def project_root @project_root end |
#renderer ⇒ Object (readonly)
Returns the value of attribute renderer
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def renderer @renderer end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def session_id @session_id end |
#session_persistence ⇒ Object (readonly)
Returns the value of attribute session_persistence
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def session_persistence @session_persistence end |
#skill_loader ⇒ Object (readonly)
Returns the value of attribute skill_loader
9 10 11 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 9 def skill_loader @skill_loader end |
Instance Method Details
#plan_mode? ⇒ Boolean
40 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 40 def plan_mode? = plan_mode |
#send_message(text) ⇒ Object
35 36 37 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 35 def (text) &.call(text) end |
#with_message_handler(handler) ⇒ Object
Convenience: return a new Context with a message handler attached. Used by commands like /review that delegate to the LLM.
30 31 32 |
# File 'lib/rubyn_code/cli/commands/context.rb', line 30 def (handler) with(message_handler: handler) end |