feat: add controlled local PXP-OA parity workflow

This commit is contained in:
codex
2026-08-06 11:17:33 +03:00
parent 0879d716dd
commit 75a1097653
8 changed files with 212 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace Launcher.Next.App;
/// <summary>Explicit automation of the same LocalParityLaunchService used by the main-window actions.</summary>
internal static class LocalParityLaunchCli
{
public static async Task<int> RunAsync(string[] args)
{
if (args.Length != 4 || args[0] != "--mode" || args[1] != "LocalParityLaunch" || args[2] != "--config") return 2;
try
{
var service = new LocalParityLaunchService();
var prepared = await service.PrepareAsync(LocalParityLaunchService.LoadProfile(args[3]), CancellationToken.None);
var launch = await service.LaunchAsync(prepared, CancellationToken.None);
return launch.TerminalState == "Succeeded" ? 0 : 1;
}
catch (Exception exception)
{
// Explicit local mode: retain a bounded diagnostic next to its supplied profile.
// Normal production and automation routes never take this path.
try { await File.WriteAllTextAsync(Path.Combine(Path.GetDirectoryName(args[3])!, "local-parity-last-error.txt"), exception.ToString()); } catch { }
return 1;
}
}
}