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 =
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.
18 19 20 |
# File 'lib/rosett_ai/workflow/manager.rb', line 18 def initialize @workflow_dir = Pathname.new(WORKFLOW_DIR) end |
Instance Method Details
#list ⇒ Array<Hash>
Lists all available workflows.
25 26 27 |
# File 'lib/rosett_ai/workflow/manager.rb', line 25 def list workflow_files.map { |path| build_workflow_summary(path) } end |
#simulate(name) ⇒ Hash
Simulates a workflow without executing.
50 51 52 53 54 |
# File 'lib/rosett_ai/workflow/manager.rb', line 50 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.
33 34 35 36 |
# File 'lib/rosett_ai/workflow/manager.rb', line 33 def validate(name) engine = build_engine(name) { errors: engine.validate } end |
#validate_all ⇒ Hash
Validates all workflows.
41 42 43 44 |
# File 'lib/rosett_ai/workflow/manager.rb', line 41 def validate_all errors = workflow_files.flat_map { |path| validate_workflow_file(path) } { errors: errors } end |