Class: Legion::Extensions::Agentic::Executive::GoalManagement::Helpers::TaskDispatcher
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Executive::GoalManagement::Helpers::TaskDispatcher
- Defined in:
- lib/legion/extensions/agentic/executive/goal_management/helpers/task_dispatcher.rb
Constant Summary collapse
- DOMAIN_RUNNERS =
{ safety: { runner_class: 'Legion::Extensions::MindGrowth::Runners::Monitor', function: :health_check, args_builder: ->(goal) { { extension: goal[:domain].to_s } } }, cognition: { runner_class: 'Legion::Extensions::MindGrowth::Runners::Analyzer', function: :recommend_priorities, args_builder: ->(_goal) { { existing_extensions: [] } } }, perception: { client_class: 'Legion::Extensions::Agentic::Learning::Curiosity::Client', function: :detect_gaps, args_builder: ->(_goal) { { prior_results: {} } } }, introspection: { client_class: 'Legion::Extensions::Agentic::Executive::Volition::Client', function: :volition_status, args_builder: ->(_goal) { {} } } }.freeze
Instance Method Summary collapse
Instance Method Details
#dispatch_goal(goal:) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/legion/extensions/agentic/executive/goal_management/helpers/task_dispatcher.rb', line 25 def dispatch_goal(goal:) domain = goal[:domain]&.to_sym mapping = DOMAIN_RUNNERS[domain] return unroutable(goal, domain) unless mapping return unroutable_not_loaded(goal, domain) unless runner_class_loaded?(mapping) execute_dispatch(goal: goal, mapping: mapping) rescue StandardError => e log.error "[task_dispatcher] dispatch error goal=#{goal[:id]} #{e.}" { dispatched: false, error: e., goal_id: goal[:id] } end |