feature: Console Replay Simulator

This commit is contained in:
voltsrage
2026-06-19 15:22:14 +08:00
parent 835311dffc
commit abc781c9c0
50 changed files with 11158 additions and 612 deletions
@@ -0,0 +1,30 @@
using System.CommandLine;
public static class DryRunCommand
{
public static Command Create()
{
var fileArg = new Argument<FileInfo>("scenario-file", "Path to the scenario JSON file");
var command = new Command("dry-run", "Print event timeline without calling the API")
{
fileArg
};
command.SetHandler(async (FileInfo file) =>
{
var scenario = ScenarioLoader.Load(file.FullName);
var errors = ScenarioValidator.Validate(scenario);
if (errors.Count > 0)
{
SimulatorConsole.Error($"Scenario validation failed with {errors.Count} error(s):");
foreach (var err in errors) SimulatorConsole.Error($" • {err}");
return;
}
var engine = new ReplayEngine(client: null!, poller: null);
await engine.RunAsync(scenario, new ReplayOptions(DryRun: true));
}, fileArg);
return command;
}
}