44
55namespace Kiboko \Component \Runtime \Workflow ;
66
7+ use Kiboko \Component \Action \Action ;
78use Kiboko \Component \Pipeline \Pipeline ;
9+ use Kiboko \Component \Runtime \Action \Console as ActionConsoleRuntime ;
810use Kiboko \Component \Runtime \Pipeline \Console as PipelineConsoleRuntime ;
911use Kiboko \Component \State ;
1012use Kiboko \Contract \Pipeline \PipelineRunnerInterface ;
11- use Kiboko \Contract \Pipeline \RunnableInterface ;
13+ use Kiboko \Contract \Satellite \RunnableInterface as JobRunnableInterface ;
1214use Symfony \Component \Console \Output \ConsoleOutput ;
1315
1416final class Console implements WorkflowRuntimeInterface
1517{
1618 private readonly State \StateOutput \Workflow $ state ;
1719
18- /** @var list<RunnableInterface > */
20+ /** @var list<JobRunnableInterface > */
1921 private array $ jobs = [];
2022
2123 public function __construct (
@@ -34,7 +36,16 @@ public function loadPipeline(string $filename): PipelineConsoleRuntime
3436 return $ factory (new PipelineConsoleRuntime ($ this ->output , $ pipeline , $ this ->state ->withPipeline (basename ($ filename ))));
3537 }
3638
37- public function job (RunnableInterface $ job ): self
39+ public function loadAction (string $ filename ): ActionConsoleRuntime
40+ {
41+ $ factory = require $ filename ;
42+
43+ $ action = new Action ();
44+
45+ return $ factory (new ActionConsoleRuntime ($ this ->output , $ action , $ this ->state ->withAction (basename ($ filename ))));
46+ }
47+
48+ public function job (JobRunnableInterface $ job ): self
3849 {
3950 $ this ->jobs [] = $ job ;
4051
0 commit comments