@@ -0,0 +1,1903 @@
+package com.github.sormuras.bach.customizable;%0A%0Aimport com.github.sormuras.bach.Bach;%0Aimport com.github.sormuras.bach.Command;%0Aimport com.github.sormuras.bach.Project;%0Aimport com.github.sormuras.bach.ToolCall;%0Aimport com.github.sormuras.bach.ToolRun;%0Aimport com.github.sormuras.bach.command.ModulePathsOption;%0Aimport com.github.sormuras.bach.project.ProjectSpace;%0Aimport java.lang.module.ModuleFinder;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.util.ArrayList;%0A%0Apublic class RunModuleWorkflow extends Workflow %7B%0A%0A  protected final ProjectSpace space;%0A  private final Command%3C?%3E command;%0A%0A  public RunModuleWorkflow(Bach bach, Project project, ProjectSpace space, Command%3C?%3E command) %7B%0A    super(bach, project);%0A    this.space = space;%0A    this.command = command;%0A  %7D%0A%0A  protected Path computeOutputDirectoryForModules(ProjectSpace space) %7B%0A    return bach.path().workspace(space.name(), %22modules%22);%0A  %7D%0A%0A  protected ModulePathsOption computeModulePathsOption() %7B%0A    var paths = ModulePathsOption.empty();%0A    for (var parent : space.parents()) paths = paths.add(computeOutputDirectoryForModules(parent));%0A    var externalModules = bach.path().externalModules();%0A    if (Files.isDirectory(externalModules)) paths = paths.add(externalModules);%0A    return paths;%0A  %7D%0A%0A  protected ModuleFinder computeRuntimeModuleFinder() %7B%0A    var paths = new ArrayList%3CPath%3E();%0A    paths.add(computeOutputDirectoryForModules(space));%0A    paths.addAll(computeModulePathsOption().values());%0A    return ModuleFinder.of(paths.toArray(Path%5B%5D::new));%0A  %7D%0A%0A  protected ToolCall computeToolCall() %7B%0A    var finder = computeRuntimeModuleFinder();%0A    return ToolCall.module(finder, command);%0A  %7D%0A%0A  protected void visitToolRun(ToolRun run) %7B%0A    bach.printer().print(run);%0A  %7D%0A%0A  @Override%0A  public void run() %7B%0A    var call = computeToolCall();%0A    var run = bach.run(call);%0A    visitToolRun(run);%0A  %7D%0A%7D%0A

Introduce workflow for running modules in-process