feat: 拆分 CLI 与网页宿主,并在无有效城市时暂停等人确认

将原单体 MAF1 拆成 MAF1(控制台工作流)和 MAF1.Web(可视化编排)。
抽城市失败时暂停:网页弹确认、CLI 控制台询问,超时采用默认结束查询;
也可改填城市后继续。共享决策模型放在 MAF1.Core。
This commit is contained in:
2026-08-28 10:43:57 +08:00
parent 5544788917
commit a3cca78592
42 changed files with 1427 additions and 457 deletions
+58
View File
@@ -0,0 +1,58 @@
using MAF1.Decisions;
namespace MAF1.Web;
public sealed class WorkflowGraph
{
public List<WorkflowNode> Nodes { get; set; } = [];
public List<WorkflowEdge> Edges { get; set; } = [];
}
public sealed class WorkflowNode
{
public string Id { get; set; } = "";
public string Type { get; set; } = "";
public string Title { get; set; } = "";
public double X { get; set; }
public double Y { get; set; }
public Dictionary<string, string> Config { get; set; } = new(StringComparer.OrdinalIgnoreCase);
}
public sealed class WorkflowEdge
{
public string Id { get; set; } = "";
public string From { get; set; } = "";
public string To { get; set; } = "";
public string FromPort { get; set; } = "";
public string ToPort { get; set; } = "";
public string? When { get; set; }
}
public static class WorkflowRunStatus
{
public const string Completed = "completed";
public const string NeedsDecision = "needsDecision";
public const string Failed = "failed";
}
public sealed class WorkflowRunResult
{
public bool Ok { get; set; }
public string Status { get; set; } = WorkflowRunStatus.Completed;
public string? RunId { get; set; }
public string? Error { get; set; }
public DecisionRequest? Decision { get; set; }
public DecisionAnswer? AppliedDecision { get; set; }
public List<NodeRunLog> Steps { get; set; } = [];
}
public sealed class NodeRunLog
{
public string NodeId { get; set; } = "";
public string Type { get; set; } = "";
public string Title { get; set; } = "";
public bool Skipped { get; set; }
public string? Message { get; set; }
public Dictionary<string, object?> Inputs { get; set; } = [];
public Dictionary<string, object?> Outputs { get; set; } = [];
}