namespace Launcher.Next.Core; public enum LauncherMode { Legacy, DryRun, NextPilot, NextPreferred } public enum PluginExecutionMode { Smoke, DryRun, Apply } public sealed record ProductInstallation(string ExecutablePath, string ProductVersion, string Architecture, IReadOnlyList Profiles); public sealed record PackageFile(string Path, long Length, string Sha256, bool Optional = false); public sealed record StartupDefinition(string Type, string Command); public sealed record PackageManifest( int SchemaVersion, string PackageId, string Version, string Product, int ProductYear, string Architecture, string EntryAssembly, IReadOnlyList Files, StartupDefinition Startup, string? MinimumLauncherVersion = null, IReadOnlyList? CompatibleAutoCadSeries = null, string? RequiredRuntime = null, IReadOnlyList? Dependencies = null, IReadOnlyList? OptionalResources = null, string? RolloutChannel = null, bool Disabled = false, bool RollbackSafe = false, string? ReleaseNotesReference = null); public sealed record ValidationIssue(string Code, string Message); public sealed record ValidationResult(IReadOnlyList Issues) { public bool IsValid => Issues.Count == 0; public static ValidationResult Success { get; } = new([]); } public sealed record PackageProgress(string Stage, int Completed, int Total); public sealed record ActivationResult(string CurrentVersion, string? PreviousVersion); public sealed record LaunchRequest(ProductInstallation Product, string Profile, string StartupScriptPath, bool DryRun); public sealed record PreparedLaunch(string Executable, IReadOnlyList Arguments, string WorkingDirectory, bool WouldStart); public interface IProductDiscovery { ProductInstallation? DiscoverPlant3D(int year); } public interface IPackageCatalogClient { Task GetManifestAsync(string packageId, CancellationToken cancellationToken); } public interface IPackageManifestValidator { ValidationResult Validate(PackageManifest manifest, int productYear, string architecture); } public interface IPackageSynchronizer { Task SynchronizeAsync(PackageManifest manifest, string sourceRoot, CancellationToken cancellationToken, IProgress? progress = null); } public interface ILocalPackageStore { Task GetCurrentVersionAsync(string packageId, CancellationToken cancellationToken); Task GetPreviousVersionAsync(string packageId, CancellationToken cancellationToken); } public interface IPackageActivator { Task ActivateAsync(string packageId, string version, CancellationToken cancellationToken); } public interface IRollbackManager { Task RollbackAsync(string packageId, CancellationToken cancellationToken); } public interface IAutodeskProcessLauncher { PreparedLaunch Prepare(LaunchRequest request); } public interface IStartupScriptBuilder { string BuildNetloadScript(string validatedPackageRoot, string entryAssembly); } public interface ILauncherConfigurationProvider { LauncherMode GetMode(); } public interface ILauncherTelemetry { void Write(string eventType, IReadOnlyDictionary? fields = null); } public interface IClock { DateTimeOffset UtcNow { get; } } public interface IFileHasher { Task Sha256Async(string path, CancellationToken cancellationToken); }