@@ -25,7 +25,7 @@ namespace GeneralUpdate.Core;
2525/// <remarks>
2626/// <para><b>Core flow:</b></para>
2727/// <para>
28- /// 1. <b>Configuration</b> — <see cref="SetConfig(Configinfo )"/> loads parameters (versions, paths, URLs).<br/>
28+ /// 1. <b>Configuration</b> — <see cref="SetConfig(UpdateRequest )"/> loads parameters (versions, paths, URLs).<br/>
2929/// 2. <b>Extension resolution</b> — <see cref="LaunchWithStrategy"/> resolves all registered
3030/// extension points (strategy, hooks, download components, network policies) and injects
3131/// them into the role strategy.<br/>
@@ -44,7 +44,7 @@ namespace GeneralUpdate.Core;
4444/// → PatchMiddleware</c> for each update version.<br/>
4545/// 6. <b>App launch</b> — the OS strategy starts the updated main application.
4646/// </para>
47- /// <para><b>Silent mode:</b> when <c>Option(UpdateOptions .Silent, true)</c> is set on
47+ /// <para><b>Silent mode:</b> when <c>Option(Option .Silent, true)</c> is set on
4848/// <see cref="AppType.Client"/>, launches a background poll loop via
4949/// <see cref="Silent.SilentPollOrchestrator"/> and returns immediately. Updates are
5050/// prepared on process exit.</para>
@@ -55,20 +55,20 @@ namespace GeneralUpdate.Core;
5555/// <example>
5656/// <code>
5757/// var result = await new GeneralUpdateBootstrap()
58- /// .SetConfig(new Configinfo {
58+ /// .SetConfig(new UpdateRequest {
5959/// UpdateUrl = "https://api.example.com",
6060/// ClientVersion = "1.0.0",
6161/// InstallPath = @"C:\MyApp",
6262/// AppSecretKey = "my-key"
6363/// })
64- /// .Option(UpdateOptions .AppType, AppType.Client)
64+ /// .SetOption(Option .AppType, AppType.Client)
6565/// .Hooks<MyCustomHooks>()
6666/// .LaunchAsync();
6767/// </code>
6868/// </example>
6969public class GeneralUpdateBootstrap : AbstractBootstrap < GeneralUpdateBootstrap , IStrategy >
7070{
71- private GlobalConfigInfo _configInfo = new ( ) ;
71+ private UpdateContext _configInfo = new ( ) ;
7272 private Func < UpdateInfoEventArgs , bool > ? _updatePrecheck ;
7373 private CancellationTokenSource ? _cts ;
7474 private DiffPipelineBuilder ? _diffPipelineBuilder ;
@@ -100,11 +100,11 @@ public void Cancel()
100100 /// <returns>This bootstrap instance for chaining.</returns>
101101 public override async Task < GeneralUpdateBootstrap > LaunchAsync ( )
102102 {
103- var appType = GetOption ( UpdateOptions . AppType ) ;
103+ var appType = GetOption ( Option . AppType ) ;
104104 _configInfo . AppType = appType ;
105105
106106 // Silent mode: start background poll and return immediately
107- if ( appType == AppType . Client && GetOption ( UpdateOptions . Silent ) )
107+ if ( appType == AppType . Client && GetOption ( Option . Silent ) )
108108 {
109109 await LaunchSilentAsync ( ) . ConfigureAwait ( false ) ;
110110 return this ;
@@ -160,23 +160,23 @@ private async Task<GeneralUpdateBootstrap> LaunchWithStrategy(IStrategy roleStra
160160
161161 /// <summary>
162162 /// Applies the primary configuration object. Validates required fields, maps to
163- /// the internal <see cref="GlobalConfigInfo "/>, and initialises the blacklist
163+ /// the internal <see cref="UpdateContext "/>, and initialises the blacklist
164164 /// matcher for file exclusion during update operations.
165165 /// </summary>
166166 /// <param name="configInfo">User-facing configuration. All required fields must
167167 /// be set explicitly — no auto-discovery is performed. Use
168168 /// <see cref="SetSource"/> for the zero-config path.</param>
169169 /// <returns>This bootstrap instance for chaining.</returns>
170- public GeneralUpdateBootstrap SetConfig ( Configinfo configInfo )
170+ public GeneralUpdateBootstrap SetConfig ( UpdateRequest configInfo )
171171 {
172172 configInfo . Validate ( ) ;
173- _configInfo = ConfigurationMapper . MapToGlobalConfigInfo ( configInfo ) ;
173+ _configInfo = ConfigurationMapper . MapToUpdateContext ( configInfo ) ;
174174
175- var appType = GetOption ( UpdateOptions . AppType ) ;
175+ var appType = GetOption ( Option . AppType ) ;
176176 if ( appType != AppType . Upgrade )
177177 {
178178 _configInfo . TempPath = StorageManager . GetTempDirectory ( "upgrade_temp" ) ;
179- InitBlackList ( ) ;
179+ InitBlackPolicy ( ) ;
180180 }
181181
182182 return this ;
@@ -193,11 +193,11 @@ public GeneralUpdateBootstrap SetConfig(Configinfo configInfo)
193193 /// <returns>This bootstrap instance for chaining.</returns>
194194 /// <exception cref="ArgumentNullException">Thrown when <paramref name="filePath"/> is <c>null</c> or whitespace.</exception>
195195 /// <exception cref="FileNotFoundException">Thrown when the specified file does not exist.</exception>
196- /// <exception cref="InvalidOperationException">Thrown when the JSON file cannot be deserialised into a valid <see cref="Configinfo "/>.</exception>
196+ /// <exception cref="InvalidOperationException">Thrown when the JSON file cannot be deserialised into a valid <see cref="UpdateRequest "/>.</exception>
197197 /// <remarks>
198- /// Reads the file content as UTF-8 JSON, deserialises it into a <see cref="Configinfo "/>
198+ /// Reads the file content as UTF-8 JSON, deserialises it into a <see cref="UpdateRequest "/>
199199 /// using the source-generated JSON serialisation context (<see cref="JsonContext.HttpParameterJsonContext"/>),
200- /// then delegates to <see cref="SetConfig(Configinfo )"/> for validation and mapping.
200+ /// then delegates to <see cref="SetConfig(UpdateRequest )"/> for validation and mapping.
201201 /// </remarks>
202202 public GeneralUpdateBootstrap SetConfig ( string filePath )
203203 {
@@ -215,7 +215,7 @@ public GeneralUpdateBootstrap SetConfig(string filePath)
215215 throw new FileNotFoundException ( $ "Config file not found: { fullPath } ") ;
216216
217217 var json = File . ReadAllText ( fullPath ) ;
218- var config = JsonSerializer . Deserialize ( json , JsonContext . HttpParameterJsonContext . Default . Configinfo ) ;
218+ var config = JsonSerializer . Deserialize ( json , JsonContext . HttpParameterJsonContext . Default . UpdateRequest ) ;
219219 if ( config == null )
220220 throw new InvalidOperationException ( $ "Failed to parse config file: { fullPath } ") ;
221221
@@ -234,7 +234,7 @@ public GeneralUpdateBootstrap SetSource(
234234 string ? scheme = null ,
235235 string ? token = null )
236236 {
237- var config = new Configinfo
237+ var config = new UpdateRequest
238238 {
239239 UpdateUrl = updateUrl ,
240240 AppSecretKey = appSecretKey ,
@@ -287,14 +287,14 @@ public GeneralUpdateBootstrap AddListenerUpdatePrecheck(Func<UpdateInfoEventArgs
287287
288288 private void InitializeFromEnvironment ( )
289289 {
290- // Read ProcessInfo via AES-encrypted file IPC.
290+ // Read ProcessContract via AES-encrypted file IPC.
291291 // The Upgrade process is only ever launched by the Client — no IPC means
292292 // there is nothing to do. The Client's manifest.json flows through IPC,
293293 // so the Upgrade never needs to load one directly.
294- var processInfo = new EncryptedFileProcessInfoProvider ( ) . Receive ( ) ;
294+ var processInfo = new EncryptedFileProcessContractProvider ( ) . Receive ( ) ;
295295 if ( processInfo == null ) return ;
296296
297- _configInfo = new GlobalConfigInfo
297+ _configInfo = new UpdateContext
298298 {
299299 MainAppName = processInfo . AppName ,
300300 InstallPath = processInfo . InstallPath ,
@@ -315,41 +315,41 @@ private void InitializeFromEnvironment()
315315 UpdatePath = processInfo . UpdatePath ,
316316 LaunchClientAfterUpdate = processInfo . LaunchClientAfterUpdate ,
317317 ReportType = processInfo . ReportType ,
318- BlackFiles = processInfo . BlackFiles ?? BlackListDefaults . DefaultBlackFiles ,
319- BlackFormats = processInfo . BlackFileFormats ?? BlackListDefaults . DefaultBlackFormats ,
320- SkipDirectorys = processInfo . SkipDirectorys ?? BlackListDefaults . DefaultSkipDirectories
318+ Files = processInfo . Files ?? BlackDefaults . DefaultFiles ,
319+ Formats = processInfo . Formats ?? BlackDefaults . DefaultFormats ,
320+ Directories = processInfo . Directories ?? BlackDefaults . DefaultDirectories
321321 } ;
322322
323- StorageManager . BlackListMatcher = DefaultBlackListMatcher . FromConfigInfo ( _configInfo ) ;
323+ StorageManager . BlackMatcher = BlackMatcher . FromConfigInfo ( _configInfo ) ;
324324 }
325325
326326 /// <summary>
327- /// Applies UpdateOptions to _configInfo.
327+ /// Applies Option to _configInfo.
328328 /// Uses ??= only for values that InitializeFromEnvironment() may have already
329329 /// populated on the Upgrade path (Encoding, Format, DownloadTimeOut).
330- /// All other options are always applied from UpdateOptions — their defaults
330+ /// All other options are always applied from Option — their defaults
331331 /// are already functionally reasonable (e.g. MaxConcurrency=3, RetryCount=3).
332332 /// </summary>
333333 private void ApplyRuntimeOptions ( )
334334 {
335335 // Preserve Upgrade path values set by InitializeFromEnvironment()
336- _configInfo . Encoding ??= GetOption ( UpdateOptions . Encoding ) ;
337- _configInfo . Format = GetOption ( UpdateOptions . Format ) ;
336+ _configInfo . Encoding ??= GetOption ( Option . Encoding ) ;
337+ _configInfo . Format = GetOption ( Option . Format ) ;
338338 if ( _configInfo . DownloadTimeOut <= 0 )
339- _configInfo . DownloadTimeOut = GetOption ( UpdateOptions . DownloadTimeout ) ?? 60 ;
339+ _configInfo . DownloadTimeOut = GetOption ( Option . DownloadTimeout ) ?? 60 ;
340340
341341 // bool? options: use ??= so user-configured false is preserved
342- _configInfo . PatchEnabled ??= GetOption ( UpdateOptions . PatchEnabled ) ;
343- _configInfo . BackupEnabled ??= GetOption ( UpdateOptions . BackupEnabled ) ;
342+ _configInfo . PatchEnabled ??= GetOption ( Option . PatchEnabled ) ;
343+ _configInfo . BackupEnabled ??= GetOption ( Option . BackupEnabled ) ;
344344
345- // Always apply from UpdateOptions — no other code sets these before
345+ // Always apply from Option — no other code sets these before
346346 // ApplyRuntimeOptions() runs. Defaults are functionally reasonable.
347- _configInfo . MaxConcurrency = GetOption ( UpdateOptions . MaxConcurrency ) ;
348- _configInfo . EnableResume = GetOption ( UpdateOptions . EnableResume ) ;
349- _configInfo . RetryCount = GetOption ( UpdateOptions . RetryCount ) ;
350- _configInfo . RetryInterval = GetOption ( UpdateOptions . RetryInterval ) ;
351- _configInfo . VerifyChecksum = GetOption ( UpdateOptions . VerifyChecksum ) ;
352- _configInfo . DiffMode = GetOption ( UpdateOptions . DiffMode ) ;
347+ _configInfo . MaxConcurrency = GetOption ( Option . MaxConcurrency ) ;
348+ _configInfo . EnableResume = GetOption ( Option . EnableResume ) ;
349+ _configInfo . RetryCount = GetOption ( Option . RetryCount ) ;
350+ _configInfo . RetryInterval = GetOption ( Option . RetryInterval ) ;
351+ _configInfo . VerifyChecksum = GetOption ( Option . VerifyChecksum ) ;
352+ _configInfo . DiffMode = GetOption ( Option . DiffMode ) ;
353353 }
354354
355355 /// <summary>
@@ -374,8 +374,8 @@ private async Task<GeneralUpdateBootstrap> LaunchSilentAsync()
374374
375375 strategy . LaunchAfterPrepare = false ;
376376
377- var pollMinutes = GetOption ( UpdateOptions . SilentPollIntervalMinutes ) ;
378- var launchClient = GetOption ( UpdateOptions . LaunchClientAfterUpdate ) ;
377+ var pollMinutes = GetOption ( Option . SilentPollIntervalMinutes ) ;
378+ var launchClient = GetOption ( Option . LaunchClientAfterUpdate ) ;
379379 var silentOptions = new Silent . SilentOptions
380380 {
381381 PollInterval = TimeSpan . FromMinutes ( pollMinutes ) ,
@@ -477,18 +477,18 @@ private static Format ParseFormat(string? compressFormat)
477477 } ;
478478 }
479479
480- private void InitBlackList ( )
480+ private void InitBlackPolicy ( )
481481 {
482- // Build blacklist matcher from GlobalConfigInfo and set on StorageManager.
482+ // Build blacklist matcher from UpdateContext and set on StorageManager.
483483 // The matcher combines user config with system defaults.
484- var effectiveConfig = new BlackListConfig (
485- _configInfo . BlackFiles ? . Count > 0 ? _configInfo . BlackFiles : BlackListDefaults . DefaultBlackFiles ,
486- _configInfo . BlackFormats ? . Count > 0 ? _configInfo . BlackFormats : BlackListDefaults . DefaultBlackFormats ,
487- _configInfo . SkipDirectorys ? . Count > 0
488- ? _configInfo . SkipDirectorys
489- : BlackListDefaults . DefaultSkipDirectories
484+ var effectiveConfig = new BlackPolicy (
485+ _configInfo . Files ? . Count > 0 ? _configInfo . Files : BlackDefaults . DefaultFiles ,
486+ _configInfo . Formats ? . Count > 0 ? _configInfo . Formats : BlackDefaults . DefaultFormats ,
487+ _configInfo . Directories ? . Count > 0
488+ ? _configInfo . Directories
489+ : BlackDefaults . DefaultDirectories
490490 ) ;
491- StorageManager . BlackListMatcher = new DefaultBlackListMatcher ( effectiveConfig ) ;
491+ StorageManager . BlackMatcher = new BlackMatcher ( effectiveConfig ) ;
492492 }
493493
494494 private async Task CallSmallBowlHomeAsync ( string processName )
0 commit comments