feat: 拆分 CLI 与网页宿主,并在无有效城市时暂停等人确认
将原单体 MAF1 拆成 MAF1(控制台工作流)和 MAF1.Web(可视化编排)。 抽城市失败时暂停:网页弹确认、CLI 控制台询问,超时采用默认结束查询; 也可改填城市后继续。共享决策模型放在 MAF1.Core。
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace MAF1.Plugins;
|
||||
|
||||
public sealed class PluginOptions
|
||||
{
|
||||
public string Directory { get; set; } = "plugins";
|
||||
public int DefaultTimeoutSeconds { get; set; } = 180;
|
||||
|
||||
public string ResolveRoot()
|
||||
{
|
||||
if (Path.IsPathRooted(Directory))
|
||||
{
|
||||
return Directory;
|
||||
}
|
||||
|
||||
return Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, Directory));
|
||||
}
|
||||
|
||||
public static PluginOptions Load(IConfiguration config)
|
||||
=> config.GetSection("Plugins").Get<PluginOptions>() ?? new PluginOptions();
|
||||
}
|
||||
|
||||
public sealed class LoadedPlugin
|
||||
{
|
||||
public required string FolderName { get; init; }
|
||||
public required string FolderPath { get; init; }
|
||||
public required PluginContract.PluginManifest Manifest { get; init; }
|
||||
}
|
||||
|
||||
public sealed class CatalogIssue
|
||||
{
|
||||
public string Level { get; init; } = "error";
|
||||
public string Source { get; init; } = "";
|
||||
public string Message { get; init; } = "";
|
||||
}
|
||||
Reference in New Issue
Block a user