Class: RosettAi::Workflow::Manager
- Inherits:
-
Object
- Object
- RosettAi::Workflow::Manager
- Defined in:
- lib/rosett_ai/workflow/manager.rb
Overview
MCP-facing facade for workflow operations.
Delegates to Engine for the actual workflow logic, providing the simplified interface expected by Mcp::Tools::WorkflowTool.
Constant Summary collapse
- WORKFLOW_DIR =
Returns Default directory for workflow definition files.
File.join(Dir.home, '.claude', 'conf', 'workflows')
Instance Method Summary collapse
-
#initialize ⇒ Manager
constructor
A new instance of Manager.
-
#list ⇒ Array<Hash>
Lists all available workflows.
-
#simulate(name) ⇒ Hash
Simulates a workflow without executing.
-
#validate(name) ⇒ Hash
Validates a specific workflow by name.
-
#validate_all ⇒ Hash
Validates all workflows.
Constructor Details
#initialize ⇒ Manager
Returns a new instance of Manager.
19 20 21 |
# File 'lib/rosett_ai/workflow/manager.rb', line 19 def initialize @workflow_dir = Pathname.new(WORKFLOW_DIR) end |
Instance Method Details
#list ⇒ Array<Hash>
Lists all available workflows.
26 27 28 |
# File 'lib/rosett_ai/workflow/manager.rb', line 26 def list workflow_files.map { |path| build_workflow_summary(path) } end |
#simulate(name) ⇒ Hash
Simulates a workflow without executing.
51 52 53 54 55 |
# File 'lib/rosett_ai/workflow/manager.rb', line 51 def simulate(name) engine = build_engine(name) steps = engine.simulate { steps: steps, duration: steps.size } end |
#validate(name) ⇒ Hash
Validates a specific workflow by name.
34 35 36 37 |
# File 'lib/rosett_ai/workflow/manager.rb', line 34 def validate(name) engine = build_engine(name) { errors: engine.validate } end |
#validate_all ⇒ Hash
Validates all workflows.
42 43 44 45 |
# File 'lib/rosett_ai/workflow/manager.rb', line 42 def validate_all errors = workflow_files.flat_map { |path| validate_workflow_file(path) } { errors: errors } end |