feat(mosstank): add VTank-style automation PoC
This commit is contained in:
parent
f6fe0f2a4f
commit
4e6e9bc9d9
212 changed files with 49462 additions and 416 deletions
|
|
@ -122,6 +122,11 @@ public sealed record RuntimeOptions(
|
|||
|
||||
public uint? PreparedAssetEffectiveRecipeVersion { get; init; }
|
||||
|
||||
/// <summary>Optional machine-local peer tags advertised to other plugin
|
||||
/// instances. Parsed once here so the live automation surface never reads
|
||||
/// process configuration directly.</summary>
|
||||
public IReadOnlyList<string> PluginTags { get; init; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Build options from the process environment. Used by
|
||||
/// <c>Program.cs</c> at startup.
|
||||
|
|
@ -247,7 +252,10 @@ public sealed record RuntimeOptions(
|
|||
StatusFilePath: null,
|
||||
Plugins: null,
|
||||
LoginCommands: [],
|
||||
LoginCommandDelayMs: 500);
|
||||
LoginCommandDelayMs: 500)
|
||||
{
|
||||
PluginTags = ParsePluginTags(env("ACDREAM_PLUGIN_TAGS")),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -367,6 +375,15 @@ public sealed record RuntimeOptions(
|
|||
private static string? NullIfEmpty(string? s)
|
||||
=> string.IsNullOrEmpty(s) ? null : s;
|
||||
|
||||
private static IReadOnlyList<string> ParsePluginTags(string? value) =>
|
||||
(value ?? string.Empty)
|
||||
.Split(',', StringSplitOptions.RemoveEmptyEntries
|
||||
| StringSplitOptions.TrimEntries)
|
||||
.Where(static tag => tag.Length <= 128)
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.Take(128)
|
||||
.ToArray();
|
||||
|
||||
private static int? TryParseInt(string? s)
|
||||
=> int.TryParse(s, NumberStyles.Integer, CultureInfo.InvariantCulture, out var v) ? v : null;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue